def test_cx_gate_nondeterministic_minimal_basis_gates(self): """Test cx-gate gate circuits compiling to U,CX""" shots = 2000 circuits = ref_2q_clifford.cx_gate_circuits_nondeterministic(final_measure=True) targets = ref_2q_clifford.cx_gate_counts_nondeterministic(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.05 * shots)
def test_cx_gate_nondeterministic_minimal_basis_gates(self): """Test cx-gate gate circuits compiling to U,CX""" shots = 2000 circuits = ref_2q_clifford.cx_gate_circuits_nondeterministic(final_measure=True) targets = ref_2q_clifford.cx_gate_counts_nondeterministic(shots) qobj = compile(circuits, self.SIMULATOR, shots=shots, basis_gates='U,CX') result = self.SIMULATOR.run(qobj, backend_options=self.BACKEND_OPTS).result() self.is_completed(result) self.compare_counts(result, circuits, targets, delta=0.05 * shots)
def test_cx_gate_nondeterministic_default_basis_gates(self): """Test cx-gate circuits compiling to backend default basis_gates.""" shots = 2000 circuits = ref_2q_clifford.cx_gate_circuits_nondeterministic( final_measure=True) qobj = qiskit_compile(circuits, QasmSimulator(), shots=shots) targets = ref_2q_clifford.cx_gate_counts_nondeterministic(shots) job = QasmSimulator().run(qobj, backend_options={"method": "ch"}) result = job.result() self.is_completed(result) self.compare_counts(result, circuits, targets, delta=0.05 * shots)