def test_qubit_lo_from_configurable_backend(self): """Test computation of qubit_lo_freq from configurable backend.""" backend = FakeArmonk() test_model = PulseSystemModel.from_backend(backend) qubit_lo_from_hamiltonian = test_model.hamiltonian.get_qubit_lo_from_drift() freqs = test_model.calculate_channel_frequencies(qubit_lo_from_hamiltonian) expected = getattr(backend.configuration(), 'hamiltonian')['vars']['wq0'] / (2 * np. pi) self.assertAlmostEqual(freqs['D0'], expected, places=4)
def test_qubit_lo_from_configurable_backend(self): backend = FakeArmonk() test_model = PulseSystemModel.from_backend(backend) qubit_lo_from_hamiltonian = test_model.hamiltonian.get_qubit_lo_from_drift( ) freqs = test_model.calculate_channel_frequencies( qubit_lo_from_hamiltonian) self.assertAlmostEqual(freqs['D0'], 4.974286046328553)
def test_control_channel_labels_from_backend(self): """Test correct importing of backend control channel description.""" backend = FakeOpenPulse2Q() system_model = PulseSystemModel.from_backend(backend) expected = [{'driven_q': 1, 'freq': '(1+0j)q0'}, {'driven_q': 0, 'freq': '(-1+0j)q0 + (1+0j)q1'}] self.assertEqual(system_model.control_channel_labels, expected)