def test_y_gate_deterministic_waltz_basis_gates(self):
     """Test y-gate gate circuits compiling to u1,u2,u3,cx"""
     circuits = ref_1q_clifford.y_gate_circuits_deterministic(final_measure=False)
     targets = ref_1q_clifford.y_gate_statevector_deterministic()
     job = execute(circuits, StatevectorSimulator(), shots=1, basis_gates=['u1', 'u2', 'u3', 'cx'])
     result = job.result()
     self.is_completed(result)
     self.compare_statevector(result, circuits, targets)
 def test_y_gate_deterministic_default_basis_gates(self):
     """Test y-gate circuits compiling to backend default basis_gates."""
     circuits = ref_1q_clifford.y_gate_circuits_deterministic(final_measure=False)
     targets = ref_1q_clifford.y_gate_statevector_deterministic()
     job = execute(circuits, StatevectorSimulator(), shots=1)
     result = job.result()
     self.is_completed(result)
     self.compare_statevector(result, circuits, targets)
Пример #3
0
 def test_y_gate_deterministic_minimal_basis_gates(self):
     """Test y-gate gate circuits compiling to U,CX"""
     shots = 100
     circuits = ref_1q_clifford.y_gate_circuits_deterministic(final_measure=True)
     targets = ref_1q_clifford.y_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)
Пример #4
0
 def test_y_gate_deterministic_default_basis_gates(self):
     """Test y-gate circuits compiling to backend default basis_gates."""
     shots = 100
     circuits = ref_1q_clifford.y_gate_circuits_deterministic(final_measure=True)
     targets = ref_1q_clifford.y_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_y_gate_deterministic_minimal_basis_gates(self):
     """Test y-gate gate circuits compiling to U,CX
     DISABLED until transpiler bug is fixed.
     """
     circuits = ref_1q_clifford.y_gate_circuits_deterministic(final_measure=False)
     targets = ref_1q_clifford.y_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)
Пример #6
0
 def test_y_gate_deterministic_default_basis_gates(self):
     """Test y-gate circuits compiling to backend default basis_gates."""
     shots = 100
     circuits = ref_1q_clifford.y_gate_circuits_deterministic(
         final_measure=True)
     qobj = qiskit_compile(circuits, QasmSimulator(), shots=shots)
     targets = ref_1q_clifford.y_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)