Skip to main content
edited body
Source Link
Joseph Geipel
  • 1.2k
  • 1
  • 6
  • 6

This is related to the transpiling of the circuit when it goes through the backend. Since global phase is non-physical, statevectors and unitary operators that differ only by a multiple of a scalar on the complex unit circle are considered equivalent, and thus the Statevector Simulator backend by default considers it both permissible and optimal to takes any "gates" that are just unit scalar multipliers it finds while transpiling anywhere in the circuit and puts them all as a global phase that is applied before all other actions. Thus, if the transpiler extracts a global phase from a gate or set of gates between psi0 and psi1, this global phase will, in the actual running of the simulator, already be applied before the point psi0 is saved. You can see what circuit is run post-transpile via the following code:

job = execute(circuit, simulator)
job._circuits[0].draw()

And should get something along the lines of:

Quantum circuit diagram showing a global phase as pi and no gate between the saving of psi0 and psi1

The RZ gate is functionally and physically the identity matrix since it is equivalent to the identity matrix multiplied by -1, so the transpiler turned init into a global phase of $\pi$ (which is a multiplication by $e^{i \pi} = -1$) applied to the statevector from the beginning. If the RZ gate were, say, split up into two RZ gates each with a rotations of $\pi$, and then a barrier were placed between the two, the transpiler wouldn't extract the global phase and move it to the front, and you would get -1 as the final inner product answer, among other potential changes that could be made to either the circuit or the configuration to avoid this behavior.

This is related to the transpiling of the circuit when it goes through the backend. Since global phase is non-physical, statevectors and unitary operators that differ only by a multiple of a scalar on the complex unit circle are considered equivalent, and thus the Statevector Simulator backend by default considers it both permissible and optimal to takes any "gates" that are just unit scalar multipliers it finds while transpiling anywhere in the circuit and puts them all as a global phase that is applied before all other actions. Thus, if the transpiler extracts a global phase from a gate or set of gates between psi0 and psi1, this global phase will, in the actual running of the simulator, already be applied before the point psi0 is saved. You can see what circuit is run post-transpile via the following code:

job = execute(circuit, simulator)
job._circuits[0].draw()

And should get something along the lines of:

Quantum circuit diagram showing a global phase as pi and no gate between the saving of psi0 and psi1

The RZ gate is functionally and physically the identity matrix since it is equivalent to the identity matrix multiplied by -1, so the transpiler turned in into a global phase of $\pi$ (which is a multiplication by $e^{i \pi} = -1$) applied to the statevector from the beginning. If the RZ gate were, say, split up into two rotations of $\pi$, and then a barrier were placed between the two, the transpiler wouldn't extract the global phase and move it to the front, and you would get -1 as the final inner product answer, among other potential changes that could be made to either the circuit or the configuration to avoid this behavior.

This is related to the transpiling of the circuit when it goes through the backend. Since global phase is non-physical, statevectors and unitary operators that differ only by a multiple of a scalar on the complex unit circle are considered equivalent, and thus the Statevector Simulator backend by default considers it both permissible and optimal to takes any "gates" that are just unit scalar multipliers it finds while transpiling anywhere in the circuit and puts them all as a global phase that is applied before all other actions. Thus, if the transpiler extracts a global phase from a gate or set of gates between psi0 and psi1, this global phase will, in the actual running of the simulator, already be applied before the point psi0 is saved. You can see what circuit is run post-transpile via the following code:

job = execute(circuit, simulator)
job._circuits[0].draw()

And should get something along the lines of:

Quantum circuit diagram showing a global phase as pi and no gate between the saving of psi0 and psi1

The RZ gate is functionally and physically the identity matrix since it is equivalent to the identity matrix multiplied by -1, so the transpiler turned it into a global phase of $\pi$ (which is a multiplication by $e^{i \pi} = -1$) applied to the statevector from the beginning. If the RZ gate were, say, split up into two RZ gates each with a rotations of $\pi$, and then a barrier were placed between the two, the transpiler wouldn't extract the global phase and move it to the front, and you would get -1 as the final inner product answer, among other potential changes that could be made to either the circuit or the configuration to avoid this behavior.

added 49 characters in body
Source Link
Joseph Geipel
  • 1.2k
  • 1
  • 6
  • 6

This is related to the transpiling of the circuit when it goes through the backend. Since global phase is non-physical, statevectors and unitary operators that differ only by a multiple of a scalar on the complex unit circle are considered equivalent, and thus the Statevector Simulator backend by default considers it kosherboth permissible and optimal to applytakes any global phases"gates" that are just unit scalar multipliers it creates whenfinds while transpiling gates anywhere in the circuit and puts them all as a global phase that is applied before all other actions. Thus, if the transpiler extracts a global phase from a gate or set of gates between psi0 and psi1, this global phase will, in the actual running of the simulator, already be applied before the point psi0 is saved. You can see what circuit is run post-transpile via the following code:

job = execute(circuit, simulator)
job._circuits[0].draw()

And should get something along the lines of:

Quantum circuit diagram showing a global phase as pi and no gate between the saving of psi0 and psi1

The RZ gate is functionally and physically the identity matrix since it is equivalent to the identity matrix multiplied by -1, so the transpiler turned in into a global phase of $\pi$ (which is a multiplication by $e^{i \pi} = -1$) applied to the statevector from the beginning. If the RZ gate were, say, split up into two rotations of $\pi$, and then a barrier were placed between the two, the transpiler wouldn't extract the global phase and move it to the front, and you would get -1 as the final inner product answer, among other potential changes that could be made to either the circuit or the configuration to avoid this behavior.

This is related to the transpiling of the circuit when it goes through the backend. Since global phase is non-physical, statevectors and unitary operators that differ only by a multiple of a scalar on the complex unit circle are considered equivalent, and thus the Statevector Simulator backend by default considers it kosher to apply any global phases it creates when transpiling gates anywhere in the circuit as a global phase that is applied before all other gates. You can see what circuit is run post-transpile via the following code:

job = execute(circuit, simulator)
job._circuits[0].draw()

And should get something along the lines of:

Quantum circuit diagram showing a global phase as pi and no gate between the saving of psi0 and psi1

The RZ gate is functionally and physically the identity matrix since it is equivalent to the identity matrix multiplied by -1, so the transpiler turned in into a global phase of $\pi$ (which is a multiplication by $e^{i \pi} = -1$) applied to the statevector from the beginning. If the RZ gate were, say, split up into two rotations of $\pi$, and then a barrier were placed between the two, the transpiler wouldn't extract the global phase and move it to the front, and you would get -1 as the final inner product answer, among other potential changes that could be made to either the circuit or the configuration to avoid this behavior.

This is related to the transpiling of the circuit when it goes through the backend. Since global phase is non-physical, statevectors and unitary operators that differ only by a multiple of a scalar on the complex unit circle are considered equivalent, and thus the Statevector Simulator backend by default considers it both permissible and optimal to takes any "gates" that are just unit scalar multipliers it finds while transpiling anywhere in the circuit and puts them all as a global phase that is applied before all other actions. Thus, if the transpiler extracts a global phase from a gate or set of gates between psi0 and psi1, this global phase will, in the actual running of the simulator, already be applied before the point psi0 is saved. You can see what circuit is run post-transpile via the following code:

job = execute(circuit, simulator)
job._circuits[0].draw()

And should get something along the lines of:

Quantum circuit diagram showing a global phase as pi and no gate between the saving of psi0 and psi1

The RZ gate is functionally and physically the identity matrix since it is equivalent to the identity matrix multiplied by -1, so the transpiler turned in into a global phase of $\pi$ (which is a multiplication by $e^{i \pi} = -1$) applied to the statevector from the beginning. If the RZ gate were, say, split up into two rotations of $\pi$, and then a barrier were placed between the two, the transpiler wouldn't extract the global phase and move it to the front, and you would get -1 as the final inner product answer, among other potential changes that could be made to either the circuit or the configuration to avoid this behavior.

added 8 characters in body
Source Link
Joseph Geipel
  • 1.2k
  • 1
  • 6
  • 6

This is related to the transpiling of the circuit when it goes through the backend. Since global phase is non-physical, statevectors and unitary operators that differ only by a multiple of a scalar on the complex unit circle are considered equivalent, and thus the Statevector Simulator backend by default considers it kosher to apply any global phases it creates when transpiling gates anywhere in the circuit as a global phase that is applied before all other gates. You can see what circuit is run post-transpile via the following code:

job = execute(circuit, simulator)
job._circuits[0].draw()

And should get something along the lines of:

Quantum circuit diagram showing a global phase as pi and no gate between the saving of psi0 and psi1

The RZ gate is functionally and physically the identity matrix since it is equivalent to the identity matrix multiplied by -1, so the transpiler turned in into a global phase of $\pi$ (which is a multiplication by $e^{i \pi} = -1$) applied to the statevector from the beginning. If the RZ gate were, say, split up into two rotations of $\pi$, and then a barrier were placed between the two, the transpiler wouldn't extract the global phase and move it to the front, and you would get -1 as the final inner product answer, among other potential changes that could be made to either the circuit or the configuration to avoid this behavior.

This is related to the transpiling of the circuit when it goes through the backend. Since global phase is non-physical, statevectors and operators that differ only by a multiple of a scalar on the complex unit circle are considered equivalent, and thus the Statevector Simulator backend by default considers it kosher to apply any global phases it creates when transpiling gates anywhere in the circuit as a global phase that is applied before all other gates. You can see what circuit is run post-transpile via the following code:

job = execute(circuit, simulator)
job._circuits[0].draw()

And should get something along the lines of:

Quantum circuit diagram showing a global phase as pi and no gate between the saving of psi0 and psi1

The RZ gate is functionally and physically the identity matrix since it is equivalent to the identity matrix multiplied by -1, so the transpiler turned in into a global phase of $\pi$ (which is a multiplication by $e^{i \pi} = -1$). If the RZ gate were, say, split up into two rotations of $\pi$, and then a barrier were placed between the two, the transpiler wouldn't extract the global phase and move it to the front, and you would get -1 as the final inner product answer, among other potential changes that could be made to either the circuit or the configuration to avoid this behavior.

This is related to the transpiling of the circuit when it goes through the backend. Since global phase is non-physical, statevectors and unitary operators that differ only by a multiple of a scalar on the complex unit circle are considered equivalent, and thus the Statevector Simulator backend by default considers it kosher to apply any global phases it creates when transpiling gates anywhere in the circuit as a global phase that is applied before all other gates. You can see what circuit is run post-transpile via the following code:

job = execute(circuit, simulator)
job._circuits[0].draw()

And should get something along the lines of:

Quantum circuit diagram showing a global phase as pi and no gate between the saving of psi0 and psi1

The RZ gate is functionally and physically the identity matrix since it is equivalent to the identity matrix multiplied by -1, so the transpiler turned in into a global phase of $\pi$ (which is a multiplication by $e^{i \pi} = -1$) applied to the statevector from the beginning. If the RZ gate were, say, split up into two rotations of $\pi$, and then a barrier were placed between the two, the transpiler wouldn't extract the global phase and move it to the front, and you would get -1 as the final inner product answer, among other potential changes that could be made to either the circuit or the configuration to avoid this behavior.

Source Link
Joseph Geipel
  • 1.2k
  • 1
  • 6
  • 6
Loading