This repository has been archived by the owner on Dec 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 376
Z.exp_i().to_matrix() disagrees with documented behavior #1218
Comments
jlapeyre
added a commit
to jlapeyre/qiskit-aqua
that referenced
this issue
Aug 30, 2020
The unitary simulator does not account for the global phase in a circuit. qiskit.quantum_info.Operator does account for global phase when converting (when possible) a circuit to a unitary matrix. Closes qiskit-community#1218
jlapeyre
added a commit
to jlapeyre/qiskit-aqua
that referenced
this issue
Aug 30, 2020
The unitary simulator does not account for the global phase in a circuit. qiskit.quantum_info.Operator does account for global phase when converting (when possible) a circuit to a unitary matrix. Closes qiskit-community#1218
jlapeyre
added a commit
to jlapeyre/qiskit-aqua
that referenced
this issue
Aug 31, 2020
The unitary simulator does not account for the global phase in a circuit. qiskit.quantum_info.Operator does account for global phase when converting (when possible) a circuit to a unitary matrix. Closes qiskit-community#1218
jlapeyre
added a commit
to jlapeyre/qiskit-aqua
that referenced
this issue
Aug 31, 2020
The unitary simulator does not account for the global phase in a circuit. qiskit.quantum_info.Operator does account for global phase when converting (when possible) a circuit to a unitary matrix. Closes qiskit-community#1218
Cryoris
pushed a commit
to Cryoris/qiskit-aqua
that referenced
this issue
Sep 3, 2020
The unitary simulator does not account for the global phase in a circuit. qiskit.quantum_info.Operator does account for global phase when converting (when possible) a circuit to a unitary matrix. Closes qiskit-community#1218
jlapeyre
added a commit
to jlapeyre/qiskit-aqua
that referenced
this issue
Sep 4, 2020
The unitary simulator does not account for the global phase in a circuit. qiskit.quantum_info.Operator does account for global phase when converting (when possible) a circuit to a unitary matrix. Closes qiskit-community#1218
jlapeyre
added a commit
that referenced
this issue
Sep 12, 2020
…ary matrix (#1224) * Fix factor of 2 error in converting exp_i to rotation gates * Make CircuitOp use Operator rather than unitary simulator to get matrix The unitary simulator does not account for the global phase in a circuit. qiskit.quantum_info.Operator does account for global phase when converting (when possible) a circuit to a unitary matrix. Closes #1218 * Remove note on reversing order of qubits Using Operator(QuantumCircuit) gives the same qubit ordering that the previous unitary-simulator-based code did. I removed the comment entirely because the behavior depends only on Operator(QuantumCircuit), which is not obscure.
jlapeyre
added a commit
to jlapeyre/qiskit-aqua
that referenced
this issue
Sep 15, 2020
…ary matrix (qiskit-community#1224) * Fix factor of 2 error in converting exp_i to rotation gates * Make CircuitOp use Operator rather than unitary simulator to get matrix The unitary simulator does not account for the global phase in a circuit. qiskit.quantum_info.Operator does account for global phase when converting (when possible) a circuit to a unitary matrix. Closes qiskit-community#1218 * Remove note on reversing order of qubits Using Operator(QuantumCircuit) gives the same qubit ordering that the previous unitary-simulator-based code did. I removed the comment entirely because the behavior depends only on Operator(QuantumCircuit), which is not obscure.
pbark
pushed a commit
to pbark/qiskit-aqua
that referenced
this issue
Sep 16, 2020
…ary matrix (qiskit-community#1224) * Fix factor of 2 error in converting exp_i to rotation gates * Make CircuitOp use Operator rather than unitary simulator to get matrix The unitary simulator does not account for the global phase in a circuit. qiskit.quantum_info.Operator does account for global phase when converting (when possible) a circuit to a unitary matrix. Closes qiskit-community#1218 * Remove note on reversing order of qubits Using Operator(QuantumCircuit) gives the same qubit ordering that the previous unitary-simulator-based code did. I removed the comment entirely because the behavior depends only on Operator(QuantumCircuit), which is not obscure.
mtreinish
pushed a commit
to mtreinish/qiskit-core
that referenced
this issue
Nov 20, 2020
…ary matrix (qiskit-community/qiskit-aqua#1224) * Fix factor of 2 error in converting exp_i to rotation gates * Make CircuitOp use Operator rather than unitary simulator to get matrix The unitary simulator does not account for the global phase in a circuit. qiskit.quantum_info.Operator does account for global phase when converting (when possible) a circuit to a unitary matrix. Closes qiskit-community/qiskit-aqua#1218 * Remove note on reversing order of qubits Using Operator(QuantumCircuit) gives the same qubit ordering that the previous unitary-simulator-based code did. I removed the comment entirely because the behavior depends only on Operator(QuantumCircuit), which is not obscure.
manoelmarques
pushed a commit
to manoelmarques/qiskit-terra
that referenced
this issue
Dec 2, 2020
…ary matrix (qiskit-community/qiskit-aqua#1224) * Fix factor of 2 error in converting exp_i to rotation gates * Make CircuitOp use Operator rather than unitary simulator to get matrix The unitary simulator does not account for the global phase in a circuit. qiskit.quantum_info.Operator does account for global phase when converting (when possible) a circuit to a unitary matrix. Closes qiskit-community/qiskit-aqua#1218 * Remove note on reversing order of qubits Using Operator(QuantumCircuit) gives the same qubit ordering that the previous unitary-simulator-based code did. I removed the comment entirely because the behavior depends only on Operator(QuantumCircuit), which is not obscure.
manoelmarques
pushed a commit
to manoelmarques/qiskit-terra
that referenced
this issue
Dec 7, 2020
…ary matrix (qiskit-community/qiskit-aqua#1224) * Fix factor of 2 error in converting exp_i to rotation gates * Make CircuitOp use Operator rather than unitary simulator to get matrix The unitary simulator does not account for the global phase in a circuit. qiskit.quantum_info.Operator does account for global phase when converting (when possible) a circuit to a unitary matrix. Closes qiskit-community/qiskit-aqua#1218 * Remove note on reversing order of qubits Using Operator(QuantumCircuit) gives the same qubit ordering that the previous unitary-simulator-based code did. I removed the comment entirely because the behavior depends only on Operator(QuantumCircuit), which is not obscure.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Z.exp_i().to_matrix()
andX.exp_i().to_matrix()
give incorrect results.What is the current behavior?
What is the expected behavior?
The docs string for
exp_i
is "Return aCircuitOp
equivalent to e^-iH for this operator H", so I expect this matrix:It looks like there are two problems
Z.exp_i()
returnsPrimitiveOp(RZGate(1))
which has a spurious (in this case) factor of 1/2 in the phase. https://github.com/Qiskit/qiskit-aqua/blob/38f727b618b0b09a2aaf6deee8ad4e5fda7fb814/qiskit/aqua/operators/primitive_ops/pauli_op.py#L228RZGate(2).to_matrix()
returns the correct matrix, butPrimitiveOp(RZGate(2)).to_matrix()
does not. The latter uses a 'unitary_simulator' to compute the matrix. This includes an additional global phase factor, which may not matter in some cases, but it does here.https://github.com/Qiskit/qiskit-aqua/blob/38f727b618b0b09a2aaf6deee8ad4e5fda7fb814/qiskit/aqua/operators/primitive_ops/circuit_op.py#L149
c8193ac Aug 13
3.8.3
linux
The text was updated successfully, but these errors were encountered: