Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maintain global phase #117

Open
aaronszasz opened this issue Feb 10, 2023 · 4 comments
Open

Maintain global phase #117

aaronszasz opened this issue Feb 10, 2023 · 4 comments
Labels
feature request New feature or request

Comments

@aaronszasz
Copy link
Contributor

Feature request: an option when compiling to maintain the global phase of the operator

@edyounis
Copy link
Member

edyounis commented Mar 10, 2023

Awesome suggestion! In 1.2, we will update the instantiation pipeline a bit, and this should definitely go in there. In the meantime, if this is important or timely for you, we can accomplish this by building a cost function for it.

@WolfLink
Copy link
Collaborator

WolfLink commented Mar 16, 2023

I think the difficulty here is it’s hard to consistently define a global phase.

For example, consider a circuit containing gate Rz(pi/4). There are two different conventions for defining the unitary of Rz(pi/4), and they have global phases e^(pi/8) off from each other. So BQSKit might consider a circuit to match the desired phase or not, depending on which convention is used.

Note that in the actual convention that BQSKit uses, Rz(pi) and Z differ by a global phase.

@edyounis
Copy link
Member

We can always easily add a global phase or correct it at the end. Don't worry about doing it during compilation.

@aaronszasz
Copy link
Contributor Author

I think there is a well-defined choice of global phase, namely that before/after compiling, the get_unitary() method should give the same matrix with the same phase. So everything should be internally consistent within bqskit, even if other programs that read qasm files later might be inconsistent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants