def test_cswap_gate_deterministic_default_basis_gates(self): shots = 100 circuits = ref_non_clifford.cswap_gate_circuits_deterministic( final_measure=True) targets = ref_non_clifford.cswap_gate_counts_deterministic(shots) job = execute(circuits, self.SIMULATOR, shots=shots) result = job.result() self.is_completed(result) self.compare_counts(result, circuits, targets, delta=0)
def test_cswap_gate_deterministic_default_basis_gates(self): shots = 100 circuits = ref_non_clifford.cswap_gate_circuits_deterministic( final_measure=True) targets = ref_non_clifford.cswap_gate_counts_deterministic(shots) job = execute(circuits, self.SIMULATOR, shots=shots, backend_options=self.BACKEND_OPTS) result = job.result() self.assertSuccess(result) self.compare_counts(result, circuits, targets, delta=0)
def test_cswap_gate_deterministic_minimal_basis_gates(self): """Test cswap-gate gate circuits compiling to u3,cx""" shots = 100 circuits = ref_non_clifford.cswap_gate_circuits_deterministic( final_measure=True) targets = ref_non_clifford.cswap_gate_counts_deterministic(shots) job = execute(circuits, self.SIMULATOR, shots=shots, basis_gates=['u3', 'cx']) result = job.result() self.is_completed(result) self.compare_counts(result, circuits, targets, delta=0)
def test_cswap_gate_deterministic_waltz_basis_gates(self): """Test cswap-gate gate circuits compiling to u1,u2,u3,cx""" shots = 100 circuits = ref_non_clifford.cswap_gate_circuits_deterministic( final_measure=True) targets = ref_non_clifford.cswap_gate_counts_deterministic(shots) job = execute(circuits, self.SIMULATOR, shots=shots, basis_gates=['u1', 'u2', 'u3', 'cx']) result = job.result() self.assertTrue(getattr(result, 'success', False)) self.compare_counts(result, circuits, targets, delta=0)