Skip to content
New issue

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

Change to circuit.measure instead of using the measure function #191

Merged
merged 2 commits into from
Feb 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
* Changed the VQE callback function for SciPy optimizers.
[(#187)](https://github.com/PennyLaneAI/pennylane-qiskit/pull/187)

* Switched from using the deprecated `qiskit.circuit.measure.measure` function
to using a method.
[(#191)](https://github.com/PennyLaneAI/pennylane-qiskit/pull/191)

### Documentation

### Bug fixes
Expand All @@ -24,7 +28,7 @@

This release contains contributions from (in alphabetical order):

Thomas Bromley, Romain Moyard, Antal Száva
Thomas Bromley, Andrea Mari, Romain Moyard, Antal Száva

---

Expand Down
3 changes: 1 addition & 2 deletions pennylane_qiskit/qiskit_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import numpy as np
from qiskit import ClassicalRegister, QuantumCircuit, QuantumRegister
from qiskit import extensions as ex
from qiskit.circuit.measure import measure
from qiskit.compiler import transpile
from qiskit.converters import circuit_to_dag, dag_to_circuit

Expand Down Expand Up @@ -237,7 +236,7 @@ def create_circuit_object(self, operations, **kwargs):
if self.backend_name not in self._state_backends:
# Add measurements if they are needed
for qr, cr in zip(self._reg, self._creg):
measure(self._circuit, qr, cr)
self._circuit.measure(qr, cr)
elif "aer" in self.backend_name:
self._circuit.save_state()

Expand Down