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

Addressed Issue #1721: Introduced a Gate for Global Phase adjustment #1810

Closed

Conversation

ismaila-at-za-ibm
Copy link
Contributor

Summary

Addressed Issue #1721: Introduced a Gate for Global Phase adjustment

Designed a new gate that results in global phase change. Even though global phase has no measurable difference to a quantum outcome, it may be useful for simulation purposes.

Details and comments

  • Added GlobalPhaseGate class to add gates (to circuits and CompositeGates) that change the global phase by a specified unital complex number. (state initializer not working correctly for some negative values #1721)
  • Added @Property getter: get_hypothetical_left_over_global_phase() to return theoretical unachieved global phase of initialization circuit.
  • Added global_phase.py to demonstrate usage of GlobalPhaseGate and get_hypothetical_left_over_global_phase

…siteGates) that

  change the global phase by a specified unital complex number. (Qiskit#1721)
- Added @Property getter: ``get_hypothetical_left_over_global_phase()`` to return
  theoretical unachieved global phase of initialization circuit.
- Added ``global_phase.py`` to demonstrate usage of ``GlobalPhaseGate`` and
  ``get_hypothetical_left_over_global_phase``
@ismaila-at-za-ibm ismaila-at-za-ibm changed the title Address issue 1721 Addressed Issue #1721: Introduced a Gate for Global Phase adjustment Feb 14, 2019
@jaygambetta
Copy link
Member

I really don't think we want to go down this path. Since our optimizer doesn't preserve global phase then when you add a global phase to an input state then after you use the optimizer you will lose it. Since quantum is insensitivity to the global phase lets not add global phase to the initializer.

There is no use case where this applies.

@ismaila-at-za-ibm
Copy link
Contributor Author

ismaila-at-za-ibm commented Feb 19, 2019

@jaygambetta

I really don't think we want to go down this path. Since our optimizer doesn't preserve global phase then when you add a global phase to an input state then after you use the optimizer you will lose it.

Yes, that's partially why, when I applied the expected global phase to complete the quantum initialisation it didn't work.

Nevertheless, this introduced gate that allows for manually changing the global phase does work. It works as expected (it passes through the compiler and gets simulated as expected).

There is no use case where this applies.
This is useful for simulation purposes.

Since quantum is insensitivity to the global phase lets not add global phase to the initializer.

This PR, doesn't change the initializer. It introduces a new gate that adjusts the global phase successfully.

@ismaila-at-za-ibm
Copy link
Contributor Author

@jaygambetta ,
Upon further thought and in private discussion with you and @ajavadia , I have arrived at the following understanding:

  • As I have stated all along, global phase is immeasurable and therefore philosophically "meaningless"
  • No algorithm requires that the user set the global phase, even for a subset of qubits. The global phase of a subset of qubits changes nothing except the global phase of all qubits.
  • The only tiny possible need to keep track of global phase, is for simulation purposes and quick automated checking that an expected state (with a specified global phase) is achieved.
  • However such a need, while plausible, runs into three problems:
    ** users need to be educated that global phase does not matter
    ** gate implementations across devices may have different global phase effects. Therefore it would be impossible for a high-level circuit (agnostic of the underlying hardware/simulations) to cleanly keep track of global phase.
    ** an ideal transpiler should actually cleverly recognise that gates whose only effect is to change the global phase should be removed!

@ewinston ewinston mentioned this pull request Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants