def test_t_gate_deterministic_default_basis_gates(self):
     """Test t-gate circuits compiling to backend default basis_gates."""
     circuits = ref_non_clifford.t_gate_circuits_deterministic(final_measure=False)
     targets = ref_non_clifford.t_gate_statevector_deterministic()
     job = execute(circuits, StatevectorSimulator(), shots=1)
     result = job.result()
     self.is_completed(result)
     self.compare_statevector(result, circuits, targets)
 def test_t_gate_deterministic_minimal_basis_gates(self):
     """Test t-gate gate circuits compiling to u3,cx"""
     circuits = ref_non_clifford.t_gate_circuits_deterministic(final_measure=False)
     targets = ref_non_clifford.t_gate_statevector_deterministic()
     job = execute(circuits, StatevectorSimulator(), shots=1, basis_gates=['u3', 'cx'])
     result = job.result()
     self.is_completed(result)
     self.compare_statevector(result, circuits, targets)
 def test_t_gate_deterministic_minimal_basis_gates(self):
     """Test t-gate gate circuits compiling to U,CX"""
     shots = 100
     circuits = ref_non_clifford.t_gate_circuits_deterministic(final_measure=True)
     targets = ref_non_clifford.t_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)
Example #4
0
 def test_t_gate_deterministic_default_basis_gates(self):
     """Test t-gate circuits compiling to backend default basis_gates."""
     shots = 100
     circuits = ref_non_clifford.t_gate_circuits_deterministic(
         final_measure=True)
     targets = ref_non_clifford.t_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)
Example #5
0
 def test_t_gate_deterministic_default_basis_gates(self):
     """Test t-gate circuits compiling to backend default basis_gates."""
     shots = 100
     circuits = ref_non_clifford.t_gate_circuits_deterministic(
         final_measure=True)
     qobj = qiskit_compile(circuits, QasmSimulator(), shots=shots)
     targets = ref_non_clifford.t_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.05 * shots)
 def test_t_gate_deterministic_minimal_basis_gates(self):
     """Test t-gate gate circuits compiling to U,CX"""
     circuits = ref_non_clifford.t_gate_circuits_deterministic(
         final_measure=False)
     targets = ref_non_clifford.t_gate_unitary_deterministic()
     job = execute(circuits,
                   UnitarySimulator(),
                   shots=1,
                   basis_gates='U,CX')
     result = job.result()
     self.is_completed(result)
     self.compare_unitary(result, circuits, targets)
 def test_t_gate_deterministic_waltz_basis_gates(self):
     """Test t-gate gate circuits compiling to u1,u2,u3,cx"""
     circuits = ref_non_clifford.t_gate_circuits_deterministic(
         final_measure=False)
     targets = ref_non_clifford.t_gate_unitary_deterministic()
     job = execute(circuits,
                   UnitarySimulator(),
                   shots=1,
                   basis_gates=['u1', 'u2', 'u3', 'cx'])
     result = job.result()
     self.is_completed(result)
     self.compare_unitary(result, circuits, targets)
Example #8
0
 def test_t_gate_deterministic_waltz_basis_gates(self):
     """Test t-gate gate circuits compiling to u1,u2,u3,cx"""
     shots = 100
     circuits = ref_non_clifford.t_gate_circuits_deterministic(
         final_measure=True)
     targets = ref_non_clifford.t_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)