<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def to_circuit(self) -> Circuit: """Convert the schedule to a circuit. This discards most timing information from the schedule, but does place operations that are scheduled at the same time in the same Moment. """

        circuit = Circuit(device=self.device)
        time = None  # type: Optional[Timestamp]
        for so in self.scheduled_operations:
            if so.time != time:
                circuit.append(so.operation,
                               strategy=InsertStrategy.NEW_THEN_INLINE)
                time = so.time
            else:
                circuit.append(so.operation,
                               strategy=InsertStrategy.INLINE)
        return circuit