* Write module-level `qiskit.circuit` documentation
I was pretty surprised to see that we had very little written for our
principal module, and the first entry in our API docs.
This is a totally new set of documentation for the `qiskit.circuit`
module, including discussion of what circuits are, what they represent
in Qiskit, how all the different data elements fit together, and where
to go for more information on things.
This commit is intended to be followed by a later one that does a
similar rewrite for the whole `QuantumCircuit` class, including
structuring its references to all its attributes and methods, and adding
a holistic view of how the methods fit together. This is why there are
some (hidden to Sphinx) `TODO` comments scattered throughout this
documentation.
* Apply suggestions from Sebastian's review
Co-authored-by: Sebastian Brandhofer <148463728+sbrandhsn@users.noreply.github.com>
* Move larger classes to separate pages
This moves the larger class definitions (basically those that actually
have any public methods) to separate pages, at the request of the docs
team. Much of this is intended to be temporary, and for most of these
classes to be moved back inline once the IBM docs platform can better
support that.
* Fix docs build with autosummary
* Switch "near time"/"runtime" terminology to "real time"
This avoids overloading "runtime" with too many meanings, and appears to
be more consistent with other messaging coming out of IBM Quantum.
* Remove misleading 'bitwise' terminology
---------
Co-authored-by: Sebastian Brandhofer <148463728+sbrandhsn@users.noreply.github.com>
* Use math and cmath instead of numpy on scalars
* Update based on review comments. Also a couple more in xx_decompose
* Update based on review comments.
With Hamamura-san having moved on from IBM now, this commit removes him
from being tagged/mentioned as a primary contact/reviewer for the
modules he'd previously been working in. We're of course happy to keep
working together, just there's no expectation anymore!
This commit deprecates Python 3.8 support. During the deprecation window
we will continue to fully support Python 3.8 and test it in CI, but it
will emit a warning that we will be removing support for 3.8 in the future
to inform users to upgrade to Python 3.9 or newer. The removal will occur
during the Qiskit 1.3.0 release as it is the first release scheduled to
occur after the upstream Python EoL date in October 2024. [1]
On the development side once we create the stable/1.2 branch on the
1.2.0rc1 release, then we can drop Python 3.8 support and raise the
minimum Python version to 3.9 (including in CI).
[1] https://devguide.python.org/versions/
* change MCPhase gate definition
* change MCX gate definition
* add release notes
* add a comment
* add to mcx gate definition the cases of 3 and 4 controls
* update release notes following review comments
* add a test for mcx with few controls
* Oxidize TwoQubitBasisDecomposer
This commit is the second part of migrating the default 2q unitary
synthesis method to leverage parallel rust as described in #8774. The
Eventual goal is to be able to run unitary synthesis in parallel for all
the unitary matrices in a single call from the `UnitarySynthesis` pass.
The TwoQubitBasisDecomposer class is one of the default decomposers used
by the unitary synthesis plugin. After this we can build an interface
that will run the decomposition in parallel for a given decomposer.
This commit re-implements the TwoQubitBasisDecomposer class in rust. It
keeps the same algorithm from the previous python version but implements
it in rust. This builds off of #11946 and for the operation of the
decomposer class the TwoQubitWeylDecomposition class is used solely
through rust.
This commit depends on #11946 and will need to be rebased after #11946
is merged.
Fixes#12004
* Fix errors after rebase
* Fix traces method
* Fix pulse optimized synthesis
* Add release notes
* Fix lint
* Use consts for static decomposition arrays
* Run cargo fmt
* Handle basis_fidelity inside unitary synthesis path
* Cast input to TwoQubitBasisDecomposer.num_basis_gates
* Use statics instead of consts
* Pre-allocate 2q circuit sequence outside the pulse optimal path.
* Added the ctrl_state parameter to mcx() function
* Fixing the Linting issue
* Fixed the Linting Issue
* Fixing Linting issue
* Added unit tests for mcx() func for ctrl_state param
* Fixed Linting Issue
* Added releasenotes for ctrl_state in mcx()
* Resolved Minor Changes
* Compose multiple final_layout attributes in routing
This commit adds functionality to the built-in routing passes for
composing an existing final layout with the routing permutation. In
PRs #9523 and #11387 we're adding new passes that introduce a
permutation prior to routing that needs to be tracked for the final
output layout to be valid. To faciliate this a new method compose() is
added to the Layout class which will combine the two layouts. Then the
built-in routing passes are updated to call compose when a layout has
already been set.
* adding inverse and to_permutation methods, tests, updating release notes
---------
Co-authored-by: AlexanderIvrii <alexi@il.ibm.com>
* update commutation checker to support utf-8 encoded gate names
* Update releasenotes/notes/commutation-checker-utf8-47b13b78a40af196.yaml
Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
* added a test case to check for compatibility with utf8 gate names
* Update test_commutation_checker.py
---------
Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
* Improve mesage on failed Graphviz optional
I have recently seen several users struggle to install a complete
version of Graphviz upon seeing the `MissingOptionalLibraryError`
message. This updates the message to make it clearer that the PyPI
distribution `graphviz` *is not* the actual Graphviz software, and it
must be installed separately.
* Tweak message
* Added test and release notes update
* Reformatting
* Added test and release notes update
* Reformatting
* Added compatibility of pulse ParameterManager with ParameterVector
It is now possible to assign to a pulse schedule parameters in the form of a list of values that can be directly binded to ParameterVector. This PR is based on the current functioning of the analogous method for the QuantumCircuit class.
* Commit requested changes
Type for submitting a list of parameters has been set to Sequence for the case of ParameterVector. This enables the user to also pass a tuple of values/ParameterExpressions
* Update pulse_parameter_manager_compat_with_ParameterVector-7d31395fd4019827.yaml
Co-authored-by: TsafrirA <113579969+TsafrirA@users.noreply.github.com>
* Added tests for Schedule and case of mix Parameter+numeric values
Complementary tests have been added for checking the pulse.Schedule.assign_parameters() method, as well as the functioning of binding to a ParameterVector a collection of numeric values and new ParameterExpression (through Parameter).
* Corrected error for schedule test
An error was occurring when trying to get access to an instruction parameter within schedule.instructions
* Correction to test schedule
* Added test and release notes update
* Reformatting
* Added test and release notes update
* Reformatting
* Added compatibility of pulse ParameterManager with ParameterVector
It is now possible to assign to a pulse schedule parameters in the form of a list of values that can be directly binded to ParameterVector. This PR is based on the current functioning of the analogous method for the QuantumCircuit class.
* Commit requested changes
Type for submitting a list of parameters has been set to Sequence for the case of ParameterVector. This enables the user to also pass a tuple of values/ParameterExpressions
* Update pulse_parameter_manager_compat_with_ParameterVector-7d31395fd4019827.yaml
Co-authored-by: TsafrirA <113579969+TsafrirA@users.noreply.github.com>
* Added tests for Schedule and case of mix Parameter+numeric values
Complementary tests have been added for checking the pulse.Schedule.assign_parameters() method, as well as the functioning of binding to a ParameterVector a collection of numeric values and new ParameterExpression (through Parameter).
* Corrected error for schedule test
An error was occurring when trying to get access to an instruction parameter within schedule.instructions
* Correction to test schedule
* Update releasenotes/notes/pulse_parameter_manager_compat_with_ParameterVector-7d31395fd4019827.yaml
Co-authored-by: Will Shanks <wshaos@posteo.net>
---------
Co-authored-by: TsafrirA <113579969+TsafrirA@users.noreply.github.com>
Co-authored-by: Will Shanks <wshaos@posteo.net>
* Document release note subsections and categorize 1.1 notes
This commit adds contributor documentation about the release note
subsections. Now that we're using subsections on main we should
encourage contributors to use the appropriate subsection when adding new
release notes to reduce the release time effort needed to correctly
categorize the release notes. This also updates the new release note
template to list out all the subsections.
This also updates the current notes pending for the 1.1.0 release to
use subsections so that from this point forward we're using subsections
for all feature, deprecation, and upgrade notes.
* Update releasenotes/notes/classical-store-e64ee1286219a862.yaml
* Add RemoveFinalReset pass
* Fix lint
* Look at predecessors of `output_map`
Suggested at https://github.com/Qiskit/qiskit/pull/11266#discussion_r1397572149
Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
* Remove `RemoveFinalReset` from preset passmanagers
This pass modifies the quantum output state of the circuit, so it
should not be run by default.
* Update remove-final-reset-488247c01c4e147d.yaml
It's no longer run by default at any optimization level.
* Fix `QiskitTestCase` import
* Update to use `DoWhileController`
---------
Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
* add an early error for a case
* Update qiskit/primitives/containers/sampler_pub.py
Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com>
* add better message for estimator pub
* Update qiskit/primitives/containers/estimator_pub.py
Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com>
* add an additional message
---------
Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com>
Since this class does complicated calculation within its `__new__`
method (as many extension classes do), we want to use an alternative
extension-module constructor for the object on unpickle, to avoid
leaking the "pickle" / "no pickle" state through the default
constructor.
This implements a private Python-space method that directly constructs
the object from components, which is then used as the `__reduce__`
target, along with the pickle state.
* add BackendEstimatorV2
* reno
* fix error for aer
* fix comments of tests
* revise aer test
* increase presion for test
* Apply suggestions from code review
Co-authored-by: Ian Hincks <ian.hincks@gmail.com>
* allow BackendV1
* add seed_simulator to constructor
* introduce options
* use dataclass for Options
* move default_precision to options
* update docstring and reno
---------
Co-authored-by: Ian Hincks <ian.hincks@gmail.com>
* Fix value formatter bug
* reno
* Comments from review
Co-authored-by: Will Shanks <wshaos@posteo.net>
---------
Co-authored-by: Will Shanks <wshaos@posteo.net>