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
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* CircuitOp uses QuantumCircuit.compose, not .combine (Qiskit#1048) * MatrixOp.to_instruction updated to return an Instruction (Qiskit#1049) * Fix hash function of PauliOp class (#1052) * Fix hash function of PauliOp class This change replaces the use of the `id()` function in the `PauliOp` hash function with the hash of its string representation. This is inline with the hash function of the `Pauli` class. This fix is necessary, since prior to this change, a set comparison including instances of identical `PauliOp`s would fail, because sets rely on hash tables. A regression test to ensure the working state after this commit is included, too. Credits for spotting and collaborating in fixing the bug go to @Cryoris * Add releasenote Co-authored-by: Julien Gacon <jules.gacon@googlemail.com> * Make cvxpy an optional dependency (Qiskit#1055) Co-authored-by: Julien Gacon <jules.gacon@googlemail.com> Co-authored-by: Max Rossmannek <oss@zurich.ibm.com> Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
- Loading branch information
1 parent
fdeb139
commit 07d1029
Showing
12 changed files
with
94 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -116,6 +116,7 @@ ctls | |
cts | ||
currentmodule | ||
cvs | ||
cvxpy | ||
cx | ||
cx's | ||
cz | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
releasenotes/notes/circuit-op-compose-register-indep-5f3fd76dbb75c84e.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
fixes: | ||
- | | ||
The ``compose`` method of the ``CircuitOp`` used ``QuantumCircuit.combine`` which has been | ||
changed to use ``QuantumCircuit.compose``. Using combine leads to the problem that composing | ||
an operator with a ``CircuitOp`` based on a named register does not chain the operators but | ||
stacks them. E.g. composing ``Z ^ 2`` with a circuit based on a 2-qubit named register yielded | ||
a 4-qubit operator instead of a 2-qubit operator. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
upgrade: | ||
- | | ||
The ``cvxpy <https://www.cvxpy.org/>`_ dependency which is required for | ||
the the svm classifier has been removed from the requirements list and made | ||
an optional dependency. This is because installing cvxpy is not seamless | ||
in every environment and often requires a compiler be installed to run. | ||
To use the svm classifier now you'll need to install cvxpy by either | ||
running ``pip install cvxpy<1.1.0`` or to install it with aqua running | ||
``pip install qiskit-aqua[cvx]``. |
7 changes: 7 additions & 0 deletions
7
releasenotes/notes/matrix-op-to-instruction-a990ec3a3db8ca8d.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
fixes: | ||
- | | ||
The ``MatrixOp.to_instruction`` method previously returned an operator and not | ||
an instruction. This method has been updated to return an Instruction. | ||
Note that this only works if the operator primitive is unitary, otherwise | ||
an error is raised upon the construction of the instruction. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
fixes: | ||
- | | ||
The ``__hash__`` method of the ``PauliOp`` class used the ``id()`` method | ||
which prevents set comparisons to work as expected since they rely on hash | ||
tables and identical objects used to not have identical hashes. Now, the | ||
implementation uses a hash of the string representation inline with the | ||
implementation in the ``Pauli`` class. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters