def test_x_gate_deterministic_waltz_basis_gates(self): """Test x-gate gate circuits compiling to u1,u2,u3,cx""" circuits = ref_1q_clifford.x_gate_circuits_deterministic(final_measure=False) targets = ref_1q_clifford.x_gate_unitary_deterministic() job = execute(circuits, UnitarySimulator(), shots=1, basis_gates=['u1', 'u2', 'u3', 'cx']) result = job.result() self.assertTrue(getattr(result, 'success', False)) self.compare_unitary(result, circuits, targets)
def test_x_gate_deterministic_default_basis_gates(self): """Test x-gate circuits compiling to backend default basis_gates.""" circuits = ref_1q_clifford.x_gate_circuits_deterministic(final_measure=False) targets = ref_1q_clifford.x_gate_unitary_deterministic() job = execute(circuits, UnitarySimulator(), shots=1) result = job.result() self.assertTrue(getattr(result, 'success', False)) self.compare_unitary(result, circuits, targets)
def test_x_gate_deterministic_minimal_basis_gates(self): """Test x-gate gate circuits compiling to u3,cx""" circuits = ref_1q_clifford.x_gate_circuits_deterministic(final_measure=False) targets = ref_1q_clifford.x_gate_unitary_deterministic() job = execute(circuits, UnitarySimulator(), shots=1, basis_gates=['u3', 'cx']) result = job.result() self.is_completed(result) self.compare_unitary(result, circuits, targets)
def test_x_gate_deterministic_default_basis_gates(self): """Test x-gate circuits compiling to backend default basis_gates.""" circuits = ref_1q_clifford.x_gate_circuits_deterministic( final_measure=False) targets = ref_1q_clifford.x_gate_unitary_deterministic() job = execute(circuits, self.SIMULATOR, shots=1, **self.BACKEND_OPTS) result = job.result() self.assertSuccess(result) self.compare_unitary(result, circuits, targets)
def test_x_gate_deterministic_waltz_basis_gates(self): """Test x-gate gate circuits compiling to u1,u2,u3,cx""" circuits = ref_1q_clifford.x_gate_circuits_deterministic( final_measure=False) targets = ref_1q_clifford.x_gate_unitary_deterministic() job = execute(circuits, self.SIMULATOR, shots=1, basis_gates=['u1', 'u2', 'u3', 'cx'], **self.BACKEND_OPTS) result = job.result() self.assertSuccess(result) self.compare_unitary(result, circuits, targets)