Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Reset global phase of the full state simulator #35

Open
@jgukelberger

Description

@jgukelberger

ResetAll on all qubits and/or deallocating all qubits should reset the global phase of the full state simulator.

The global phase of the wavefunction is arbitrary and has no effect on measurements. However, it is reflected in the DumpMachine and DumpRegister outputs. Currently, the simulator retains a nontrivial phase even when the user goes through a sequence that should reset it to a clean state, such as deallocating all qubits. This leads to the confusing behavior that the same gate sequence applied to supposedly identical initial states (created, e.g., by releasing and allocating all qubits or applying ResetAll to all qubits) leads to different machine states, as observed through the dumps. It also makes the process of checking dumps against reference states for debugging purposes more involved than needed.

An alternative would be to have the dump functions normalize the global phase in a consistent and reproducible way. However, this would not cover some debugging scenarios where one would like the phase between different state dumps to be consistent. (E.g.: Apply the same gate sequence to the computational basis states in order to reconstruct the full unitary matrix implemented by the computation.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: target machinesTarget machines like the quantum, trace, or Toffoli simulatorsenhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions