Exemple #1
0
 def test_diagonal_gate(self):
     """Test simulation with unitary gate circuit instructions."""
     shots = 100
     circuits = ref_diagonal_gate.diagonal_gate_circuits_deterministic(
         final_measure=True)
     targets = ref_diagonal_gate.diagonal_gate_counts_deterministic(shots)
     result = execute(circuits, self.SIMULATOR, shots=shots).result()
     self.assertTrue(getattr(result, 'success', False))
     self.compare_counts(result, circuits, targets, delta=0)
 def test_diagonal_gate(self):
     """Test simulation with unitary gate circuit instructions."""
     shots = 100
     circuits = ref_diagonal_gate.diagonal_gate_circuits_deterministic(
         final_measure=True)
     targets = ref_diagonal_gate.diagonal_gate_counts_deterministic(
         shots)
     result = execute(circuits, self.SIMULATOR, shots=shots,
                      backend_options=self.BACKEND_OPTS).result()
     self.assertSuccess(result)
     self.compare_counts(result, circuits, targets, delta=0)
 def test_diagonal_gate(self, method, device):
     """Test simulation with unitary gate circuit instructions."""
     backend = self.backend(method=method, device=device)
     shots = 100
     circuits = ref_diagonal_gate.diagonal_gate_circuits_deterministic(
         final_measure=True)
     targets = ref_diagonal_gate.diagonal_gate_counts_deterministic(shots)
     circuits = transpile(circuits, backend)
     result = backend.run(circuits, shots=shots).result()
     self.assertSuccess(result)
     self.compare_counts(result, circuits, targets, delta=0)