Closed martin-rv closed 3 years ago
Hello @martin-rv, thank you for your interest in Mitiq! If this is a bug report, please provide screenshots and/or minimum viable code to reproduce your issue, so we can do our best to help get it fixed. If you have any questions in the meantime, you can also ask us on the Unitary Fund Discord.
About my installation:
Authored by: Mitiq team, 2020 & later (https://github.com/unitaryfund/mitiq)
Mitiq Version: 0.9.1
Cirq Version: 0.10.0 NumPy Version: 1.20.1 SciPy Version: 1.4.1
PyQuil Version: Not installed Qiskit Version: 0.27.0 Braket Version: Not installed
Python Version: 3.8.8 Platform Info: Windows (AMD64)
Thanks @martin-rv, I confirmed this behavior. It is due to your Qiskit version - currently we aren't compatible with Qiskit 0.27.0.
I just checked the example works when you pip install qiskit==0.24.0
. You can use this Qiskit version with Mitiq in the meantime until we decide a longer-term action for this issue.
Thanks again for reporting this and please let us know if you run into further issues.
Thanks for your quick reply, @rmlarose! I installed Qiskit version 0.24 as you recommended, and the example works now.
I am planning to use Mitiq for my research (we are modeling materials with quantum computers), so I look forward to integration with the latest Qiskit version.
Dear Mitiq team,
I am trying to use mitiq to perform error mitigation in my calculation. With my installation, I can successfully run the code for cirq in the "Getting Started" section.
https://mitiq.readthedocs.io/en/stable/readme.html
However, when I try the Qiskit example in
https://mitiq.readthedocs.io/en/stable/examples/ibmq-backends.html
I get errors (see below) that go beyond my experience.
Any help would be appreciated.
Best, Martin
`import qiskit import mitiq from mitiq.zne import execute_with_zne
qreg, creg = qiskit.QuantumRegister(1), qiskit.ClassicalRegister(1) circuit = qiskit.QuantumCircuit(qreg, creg) for _ in range(10): circuit.x(qreg) circuit.measure(qreg, creg)
if qiskit.IBMQ.stored_account(): provider = qiskit.IBMQ.load_account() backend = provider.get_backend("ibmq_qasm_simulator") # Set quantum computer here! else:
Default to a simulator.
def ibmq_executor(circuit: qiskit.QuantumCircuit, shots: int = 1024) -> float: """Returns the expectation value to be mitigated.
mitigated = mitiq.zne.execute_with_zne(circuit, ibmq_executor)`
I get the error
`CircuitError Traceback (most recent call last)