示例#1
0
 def test_active_circuit_scheduler_settings(self):
     """Test setting settings of active builder's circuit scheduler."""
     with pulse.build(self.backend):
         self.assertFalse(pulse.active_circuit_scheduler_settings())
         with pulse.circuit_scheduler_settings(test_setting=1):
             self.assertEqual(
                 pulse.active_circuit_scheduler_settings()['test_setting'], 1)
示例#2
0
    def test_scheduler_settings(self):
        """Test the circuit scheduler settings context."""
        inst_map = pulse.InstructionScheduleMap()
        d0 = pulse.DriveChannel(0)
        test_x_sched = pulse.Schedule()
        test_x_sched += instructions.Delay(10, d0)
        inst_map.add('x', (0,), test_x_sched)

        x_qc = circuit.QuantumCircuit(2)
        x_qc.x(0)

        with pulse.build(backend=self.backend) as schedule:
            with pulse.transpiler_settings(basis_gates=['x']):
                with pulse.circuit_scheduler_settings(inst_map=inst_map):
                    builder.call_circuit(x_qc)

        self.assertEqual(schedule, test_x_sched)