def setUp(self): self.device = DeviceSpecification(qubits=[ Qubit(0, drive_channels=[DriveChannel(0, 1.2)], acquire_channels=[AcquireChannel(0)]) ], registers=[RegisterSlot(0)], mem_slots=[MemorySlot(0)])
def setUp(self): self.device = DeviceSpecification( qubits=[ Qubit(0, DriveChannel(0), MeasureChannel(0), AcquireChannel(0)) ], registers=[ RegisterSlot(0) ], mem_slots=[ MemorySlot(0) ] )
def setUp(self): qubits = [ Qubit(0, drive_channels=[DriveChannel(0, 1.2)], control_channels=[ControlChannel(0)]), Qubit(1, drive_channels=[DriveChannel(1, 3.4)], acquire_channels=[AcquireChannel(1)]) ] registers = [RegisterSlot(i) for i in range(2)] mem_slots = [MemorySlot(i) for i in range(2)] self.two_qubit_device = DeviceSpecification(qubits, registers, mem_slots)
def setUp(self): @functional_pulse def linear(duration, slope, intercept): x = np.linspace(0, duration - 1, duration) return slope * x + intercept self.linear = linear qubits = [Qubit(0, DriveChannel(0), AcquireChannel(0), MeasureChannel(0), control_channels=[ControlChannel(0)]), Qubit(1, DriveChannel(1), MeasureChannel(0), AcquireChannel(1))] registers = [RegisterSlot(i) for i in range(2)] mem_slots = [MemorySlot(i) for i in range(2)] self.two_qubit_device = DeviceSpecification(qubits, registers, mem_slots)
def setUp(self): self.linear = SamplePulse(np.arange(0, 0.01), name='linear') self.pulse_library = [ PulseLibraryItem(name=self.linear.name, samples=self.linear.samples.tolist()) ] self.converter = QobjToInstructionConverter(self.pulse_library, buffer=0) self.device = DeviceSpecification(qubits=[ Qubit(0, DriveChannel(0), MeasureChannel(0), AcquireChannel(0)) ], registers=[RegisterSlot(0)], mem_slots=[MemorySlot(0)])
def setUp(self): super().setUp() qubits = [ Qubit(0, DriveChannel(0), AcquireChannel(0), MeasureChannel(0), control_channels=[ControlChannel(0)]), Qubit(1, DriveChannel(1), MeasureChannel(0), AcquireChannel(1)) ] registers = [RegisterSlot(i) for i in range(2)] mem_slots = [MemorySlot(i) for i in range(2)] self.two_qubit_device = DeviceSpecification(qubits, registers, mem_slots)
def test_default(self): """Test default device specification. """ qubits = [ Qubit(0, DriveChannel(0), MeasureChannel(0), AcquireChannel(0)), Qubit(1, DriveChannel(1), MeasureChannel(1), AcquireChannel(1)) ] registers = [RegisterSlot(i) for i in range(2)] mem_slots = [MemorySlot(i) for i in range(2)] spec = DeviceSpecification(qubits, registers, mem_slots) self.assertEqual(spec.q[0].drive, DriveChannel(0)) self.assertEqual(spec.q[1].acquire, AcquireChannel(1)) self.assertEqual(spec.mem[0], MemorySlot(0)) self.assertEqual(spec.c[1], RegisterSlot(1))
def setUp(self): self.schedule = Schedule() self.qubits = [ Qubit(0, drive_channel=DriveChannel(0), control_channels=[ControlChannel(0)], measure_channel=MeasureChannel(0), acquire_channel=AcquireChannel(0)), Qubit(1, drive_channel=DriveChannel(1), acquire_channel=AcquireChannel(1), measure_channel=MeasureChannel(1)) ] self.registers = [RegisterSlot(i) for i in range(2)] self.mem_slots = [MemorySlot(i) for i in range(2)] self.device = DeviceSpecification(self.qubits, self.registers, self.mem_slots)