def test_x_gate_deterministic_minimal_basis_gates(self): """Test x-gate gate circuits compiling to U,CX""" shots = 100 circuits = ref_1q_clifford.x_gate_circuits_deterministic(final_measure=True) targets = ref_1q_clifford.x_gate_counts_deterministic(shots) job = execute(circuits, QasmSimulator(), shots=shots, basis_gates='U,CX') result = job.result() self.is_completed(result) self.compare_counts(result, circuits, targets, delta=0)
def test_x_gate_deterministic_default_basis_gates(self): """Test x-gate circuits compiling to backend default basis_gates.""" shots = 100 circuits = ref_1q_clifford.x_gate_circuits_deterministic(final_measure=True) targets = ref_1q_clifford.x_gate_counts_deterministic(shots) qobj = compile(circuits, self.SIMULATOR, shots=shots) result = self.SIMULATOR.run(qobj, backend_options=self.BACKEND_OPTS).result() self.is_completed(result) self.compare_counts(result, circuits, targets, delta=0)
def test_x_gate_deterministic_default_basis_gates(self): """Test x-gate circuits compiling to backend default basis_gates.""" shots = 100 circuits = ref_1q_clifford.x_gate_circuits_deterministic( final_measure=True) qobj = qiskit_compile(circuits, QasmSimulator(), shots=shots) targets = ref_1q_clifford.x_gate_counts_deterministic(shots) job = QasmSimulator().run(qobj, backend_options={"method": "ch"}) result = job.result() self.is_completed(result) self.compare_counts(result, circuits, targets, delta=0)