Skip to content

Commit

Permalink
Backport global phase from Qiskit#5517 on grover operator
Browse files Browse the repository at this point in the history
This commit adds a missing phase of pi to the grover operator circuit
library entry. It is a backport from Qiskit#5517.
  • Loading branch information
mtreinish committed Jan 25, 2021
1 parent 44092e4 commit aa19b72
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions qiskit/circuit/library/grover_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,8 @@ def _build(self):
self.barrier()
self.compose(self.state_preparation, list(range(self.state_preparation.num_qubits)),
inplace=True)
# minus sign
self.global_phase = numpy.pi


# TODO use the oracle compiler or the bit string oracle
Expand Down

0 comments on commit aa19b72

Please sign in to comment.