We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
So far, when taking expectation values, I convert to quimb operators manually. For instance, given a CircuitMPS:
CircuitMPS
mps.local_expectation(quimb.pauli('Z') & quimb.pauli('Z'), (3, 4)).real.item()
I wonder if there's a better way, or a way we could enable users to use SparsePauliOp and its successor and have the conversion to quimb be automatic.
SparsePauliOp
The text was updated successfully, but these errors were encountered:
I dug up this function I wrote at some point, but I don't remember how I used it. Not sure if it's useful.
def quimb_paulis(pauli_list: PauliList): result = [] for qiskit_pauli in pauli_list: quimb_pauli_list = [] for i, p in enumerate(reversed(qiskit_pauli.to_label())): if p != "I": quimb_pauli_list.append((quimb.pauli(p), i)) if quimb_pauli_list: paulis, qubits = zip(*quimb_pauli_list) pauli = functools.reduce(lambda a, b: a & b, paulis) else: pauli = 1.0 qubits = [] result.append((pauli, qubits)) return result
Sorry, something went wrong.
OK, that is probably going to be useful to reference.
No branches or pull requests
So far, when taking expectation values, I convert to quimb operators manually. For instance, given a
CircuitMPS
:I wonder if there's a better way, or a way we could enable users to use
SparsePauliOp
and its successor and have the conversion to quimb be automatic.The text was updated successfully, but these errors were encountered: