def test_measurement_map_and_backend_not_supplied(self): """Test measurement map and backend not supplied.""" with self.assertRaisesRegex( QiskitError, r"Must supply either a backend or a meas_map for scheduling passes.", ): schedule(self.circ, inst_map=InstructionScheduleMap())
def test_instruction_map_and_backend_not_supplied(self): """Test instruction map and backend not supplied.""" with self.assertRaisesRegex( QiskitError, r"Must supply either a backend or InstructionScheduleMap for scheduling passes.", ): schedule(self.circ)
def test_instruction_map_and_backend_defaults_unavailable(self): """Test backend defaults unavailable when backend is provided, but instruction map is not.""" self.backend._defaults = None with self.assertRaisesRegex( QiskitError, r"The backend defaults are unavailable. The backend may not support pulse." ): schedule(self.circ, self.backend)
def test_schedules_multiple_circuits(self): """Test scheduling of multiple circuits.""" self.enable_parallel_processing() circuits = [self.circ, self.circ2] circuit_schedules = schedule(circuits, self.backend, method="asap") self.assertEqual(len(circuit_schedules), len(circuits)) circuit_one_schedule = circuit_schedules[0] circuit_two_schedule = circuit_schedules[1] self.assertEqual( circuit_one_schedule, schedule(self.circ, self.backend, method="asap"), ) self.assertEqual( circuit_two_schedule, schedule(self.circ2, self.backend, method="asap"), )
def test_schedules_single_circuit(self): """Test scheduling of a single circuit.""" circuit_schedule = schedule(self.circ, self.backend) self.assertIsInstance(circuit_schedule, Schedule) self.assertEqual(circuit_schedule.name, "circ")