def test_ccx_gate_deterministic_minimal_basis_gates(self): """Test ccx-gate gate circuits compiling to U,CX""" shots = 100 circuits = ref_non_clifford.ccx_gate_circuits_deterministic(final_measure=True) targets = ref_non_clifford.ccx_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_ccx_gate_deterministic_default_basis_gates(self): """Test ccx-gate circuits compiling to backend default basis_gates.""" shots = 100 circuits = ref_non_clifford.ccx_gate_circuits_deterministic( final_measure=True) targets = ref_non_clifford.ccx_gate_counts_deterministic(shots) qobj = compile(circuits, self.SIMULATOR, shots=shots) result = self.SIMULATOR.run(qobj).result() self.is_completed(result) self.compare_counts(result, circuits, targets, delta=0)
def test_ccx_gate_deterministic_waltz_basis_gates(self): """Test ccx-gate gate circuits compiling to u1,u2,u3,cx""" shots = 100 circuits = ref_non_clifford.ccx_gate_circuits_deterministic( final_measure=True) targets = ref_non_clifford.ccx_gate_counts_deterministic(shots) qobj = compile(circuits, self.SIMULATOR, shots=shots, basis_gates=['u1', 'u2', 'u3', 'cx']) result = self.SIMULATOR.run(qobj).result() self.is_completed(result) self.compare_counts(result, circuits, targets, delta=0)
def test_ccx_gate_deterministic_default_basis_gates(self): """Test ccx-gate circuits compiling to backend default basis_gates.""" shots = 100 circuits = ref_non_clifford.ccx_gate_circuits_deterministic(final_measure=True) qobj = qiskit_compile(circuits, QasmSimulator(), shots=shots) targets = ref_non_clifford.ccx_gate_counts_deterministic(shots) job = QasmSimulator().run(qobj, backend_options={ "method": "ch", "ch_mixing_time": 100 }) result = job.result() self.is_completed(result) self.compare_counts(result, circuits, targets, delta=0.05 * shots)