diff --git a/constraints.txt b/constraints.txt index 843e81eac27f..d83b14921dbf 100644 --- a/constraints.txt +++ b/constraints.txt @@ -1,2 +1 @@ -matplotlib==3.2.0rc1;python_version=='3.8' nbformat==4.4.0 diff --git a/qiskit/circuit/__init__.py b/qiskit/circuit/__init__.py index 4dd035798443..6003ffbd20dd 100644 --- a/qiskit/circuit/__init__.py +++ b/qiskit/circuit/__init__.py @@ -38,6 +38,7 @@ :toctree: ../stubs/ Gate + ControlledGate Measure Reset Instruction diff --git a/qiskit/pulse/__init__.py b/qiskit/pulse/__init__.py index 88ed5f74fcc0..f00368cc8090 100644 --- a/qiskit/pulse/__init__.py +++ b/qiskit/pulse/__init__.py @@ -41,6 +41,7 @@ Instruction Acquire + AcquireInstruction FrameChange PersistentValue SamplePulse @@ -49,6 +50,13 @@ Discriminator Delay functional_pulse + ParametricPulse + ParametricInstruction + Gaussian + GaussianSquare + Drag + ConstantPulse + functional_pulse Schedules ========= @@ -82,9 +90,10 @@ MeasureChannel, AcquireChannel, ControlChannel, RegisterSlot, MemorySlot) from .cmd_def import CmdDef -from .commands import (Instruction, Acquire, FrameChange, PersistentValue, - SamplePulse, Snapshot, Kernel, Discriminator, Delay, - ParametricPulse, ParametricInstruction, Gaussian, +from .commands import (Instruction, Acquire, AcquireInstruction, FrameChange, + PersistentValue, SamplePulse, Snapshot, Kernel, + Discriminator, Delay, ParametricPulse, + ParametricInstruction, Gaussian, GaussianSquare, Drag, ConstantPulse, functional_pulse) from .configuration import LoConfig, LoRange from .exceptions import PulseError diff --git a/qiskit/pulse/commands/parametric_pulses.py b/qiskit/pulse/commands/parametric_pulses.py index b88d69c31d60..cfaf22e858e8 100644 --- a/qiskit/pulse/commands/parametric_pulses.py +++ b/qiskit/pulse/commands/parametric_pulses.py @@ -127,6 +127,8 @@ class Gaussian(ParametricPulse): A truncated pulse envelope shaped according to the Gaussian function whose mean is centered at the center of the pulse (duration / 2): + .. math:: + f(x) = amp * exp( -(1/2) * (x - duration/2)^2 / sigma^2) ) , 0 <= x < duration """ @@ -178,15 +180,20 @@ class GaussianSquare(ParametricPulse): """ A square pulse with a Gaussian shaped risefall on either side: + .. math:: + risefall = (duration - width) / 2 - 0 <= x < risefall + 0 <= x < risefall + f(x) = amp * exp( -(1/2) * (x - risefall/2)^2 / sigma^2) ) - risefall <= x < risefall + width + risefall <= x < risefall + width + f(x) = amp - risefall + width <= x < duration + risefall + width <= x < duration + f(x) = amp * exp( -(1/2) * (x - (risefall + width)/2)^2 / sigma^2) ) """ @@ -252,10 +259,15 @@ class Drag(ParametricPulse): spectrum of a normal gaussian pulse near the |1>-|2> transition, reducing the chance of leakage to the |2> state. + .. math:: + f(x) = Gaussian + 1j * beta * d/dx [Gaussian] = Gaussian + 1j * beta * (-(x - duration/2) / sigma^2) [Gaussian] where 'Gaussian' is: + + .. math:: + Gaussian(x, amp, sigma) = amp * exp( -(1/2) * (x - duration/2)^2 / sigma^2) ) Ref: @@ -344,6 +356,8 @@ class ConstantPulse(ParametricPulse): """ A simple constant pulse, with an amplitude value and a duration: + .. math:: + f(x) = amp , 0 <= x < duration f(x) = 0 , elsewhere """ diff --git a/releasenotes/notes/0.12/0.12.0-release-d787c88f1d8815d4.yaml b/releasenotes/notes/0.12/0.12.0-release-d787c88f1d8815d4.yaml new file mode 100644 index 000000000000..386eee53b4be --- /dev/null +++ b/releasenotes/notes/0.12/0.12.0-release-d787c88f1d8815d4.yaml @@ -0,0 +1,9 @@ +--- +prelude: > + The 0.12.0 release includes several new features and bug fixes. The biggest + changes for this release is the addition of support for parametric pulses + to OpenPulse. These are Pulse commands which take parameters rather than + sample points to describe a pulse. 0.12.0 is also the first release to + include support for Python 3.8. It also marks the beginning of the + deprecation for Python 3.5 support, which will be removed when the upstream + community stops supporting it. diff --git a/releasenotes/notes/0.12/2482-decompose-does-not-propagate-bound-parameters-71fb409de3416255.yaml b/releasenotes/notes/0.12/2482-decompose-does-not-propagate-bound-parameters-71fb409de3416255.yaml new file mode 100644 index 000000000000..0fbf24b4a6cd --- /dev/null +++ b/releasenotes/notes/0.12/2482-decompose-does-not-propagate-bound-parameters-71fb409de3416255.yaml @@ -0,0 +1,9 @@ +--- +fixes: + - | + Previously, calling :meth:`qiskit.circuit.QuantumCircuit.bind_parameters` + prior to decomposing a circuit would result in the bound values not being + correctly substituted into the decomposed gates. This has been resolved + such that binding and decomposition may occur in any order. Fixes + `issue #2482 `_ and + `issue #3509 `_ diff --git a/releasenotes/notes/3215-ConsolidateBlocks-drops-classical-conditional-c5ed03f9a6d15284.yaml b/releasenotes/notes/0.12/3215-ConsolidateBlocks-drops-classical-conditional-c5ed03f9a6d15284.yaml similarity index 52% rename from releasenotes/notes/3215-ConsolidateBlocks-drops-classical-conditional-c5ed03f9a6d15284.yaml rename to releasenotes/notes/0.12/3215-ConsolidateBlocks-drops-classical-conditional-c5ed03f9a6d15284.yaml index 5ee28c9d4750..24ae9da8b7cf 100644 --- a/releasenotes/notes/3215-ConsolidateBlocks-drops-classical-conditional-c5ed03f9a6d15284.yaml +++ b/releasenotes/notes/0.12/3215-ConsolidateBlocks-drops-classical-conditional-c5ed03f9a6d15284.yaml @@ -1,9 +1,10 @@ --- fixes: - | - The `Collect2qBlocks` pass had previously not considered classical + The ``Collect2qBlocks`` pass had previously not considered classical conditions when determining whether to include a gate within an existing block. In some cases, this resulted in classical conditions being lost when transpiling with - `optimization_level=3`. This has been resolved so that classically + ``optimization_level=3``. This has been resolved so that classically conditioned gates are never included in a block. + Fixes `issue #3215 `_ diff --git a/releasenotes/notes/0.12/3399-Change-QuantumCircuit-method-input-arg-names-8422b6abfdfff081.yaml b/releasenotes/notes/0.12/3399-Change-QuantumCircuit-method-input-arg-names-8422b6abfdfff081.yaml new file mode 100644 index 000000000000..ef01a37ca1df --- /dev/null +++ b/releasenotes/notes/0.12/3399-Change-QuantumCircuit-method-input-arg-names-8422b6abfdfff081.yaml @@ -0,0 +1,99 @@ +--- +deprecations: + - | + Methods for adding gates to a :class:`qiskit.circuit.QuantumCircuit` with + abbreviated keyword arguments (e.g. ``ctl``, ``tgt``) have had their keyword + arguments renamed to be more descriptive (e.g. ``control_qubit``, + ``target_qubit``). The old names have been deprecated. A table including the + old and new calling signatures for the ``QuantumCircuit`` methods is included below. + + .. list-table:: New signatures for ``QuantumCircuit`` gate methods + :header-rows: 1 + + * - Instruction Type + - Former Signature + - New Signature + * - :class:`qiskit.extensions.HGate` + - ``qc.h(q)`` + - ``qc.h(qubit)`` + * - :class:`qiskit.extensions.CHGate` + - ``qc.ch(ctl, tgt)`` + - ``qc.ch((control_qubit, target_qubit))`` + * - :class:`qiskit.extensions.IdGate` + - ``qc.iden(q)`` + - ``qc.iden(qubit)`` + * - :class:`qiskit.extensions.RGate` + - ``qc.iden(q)`` + - ``qc.iden(qubit)`` + * - :class:`qiskit.extensions.RGate` + - ``qc.r(theta, phi, q)`` + - ``qc.r(theta, phi, qubit)`` + * - :class:`qiskit.extensions.RXGate` + - ``qc.rx(theta, q)`` + - ``qc.rx(theta, qubit)`` + * - :class:`qiskit.extensions.CrxGate` + - ``qc.crx(theta, ctl, tgt)`` + - ``qc.crx(theta, control_qubit, target_qubit)`` + * - :class:`qiskit.extensions.RYGate` + - ``qc.ry(theta, q)`` + - ``qc.ry(theta, qubit)`` + * - :class:`qiskit.extensions.CryGate` + - ``qc.cry(theta, ctl, tgt)`` + - ``qc.cry(theta, control_qubit, target_qubit)`` + * - :class:`qiskit.extensions.RZGate` + - ``qc.rz(phi, q)`` + - ``qc.rz(phi, qubit)`` + * - :class:`qiskit.extensions.CrzGate` + - ``qc.crz(theta, ctl, tgt)`` + - ``qc.crz(theta, control_qubit, target_qubit)`` + * - :class:`qiskit.extensions.SGate` + - ``qc.s(q)`` + - ``qc.s(qubit)`` + * - :class:`qiskit.extensions.SdgGate` + - ``qc.sdg(q)`` + - ``qc.sdg(qubit)`` + * - :class:`qiskit.extensions.FredkinGate` + - ``qc.cswap(ctl, tgt1, tgt2)`` + - ``qc.cswap(control_qubit, target_qubit1, target_qubit2)`` + * - :class:`qiskit.extensions.TGate` + - ``qc.t(q)`` + - ``qc.t(qubit)`` + * - :class:`qiskit.extensions.TdgGate` + - ``qc.tdg(q)`` + - ``qc.tdg(qubit)`` + * - :class:`qiskit.extensions.U1Gate` + - ``qc.u1(theta, q)`` + - ``qc.u1(theta, qubit)`` + * - :class:`qiskit.extensions.Cu1Gate` + - ``qc.cu1(theta, ctl, tgt)`` + - ``qc.cu1(theta, control_qubit, target_qubit)`` + * - :class:`qiskit.extensions.U2Gate` + - ``qc.u2(phi, lam, q)`` + - ``qc.u2(phi, lam, qubit)`` + * - :class:`qiskit.extensions.U3Gate` + - ``qc.u3(theta, phi, lam, q)`` + - ``qc.u3(theta, phi, lam, qubit)`` + * - :class:`qiskit.extensions.Cu3Gate` + - ``qc.cu3(theta, phi, lam, ctl, tgt)`` + - ``qc.cu3(theta, phi, lam, control_qubit, target_qubit)`` + * - :class:`qiskit.extensions.XGate` + - ``qc.x(q)`` + - ``qc.x(qubit)`` + * - :class:`qiskit.extensions.CnotGate` + - ``qc.cx(ctl, tgt)`` + - ``qc.cx(control_qubit, target_qubit)`` + * - :class:`qiskit.extensions.ToffoliGate` + - ``qc.ccx(ctl1, ctl2, tgt)`` + - ``qc.ccx(control_qubit1, control_qubit2, target_qubit)`` + * - :class:`qiskit.extensions.YGate` + - ``qc.y(q)`` + - ``qc.y(qubit)`` + * - :class:`qiskit.extensions.CyGate` + - ``qc.cy(ctl, tgt)`` + - ``qc.cy(control_qubit, target_qubit)`` + * - :class:`qiskit.extensions.ZGate` + - ``qc.z(q)`` + - ``qc.z(qubit)`` + * - :class:`qiskit.extensions.CzGate` + - ``qc.cz(ctl, tgt)`` + - ``qc.cz(control_qubit, target_qubit)`` diff --git a/releasenotes/notes/0.12/CSPLayout_limit-e0643857e866d1ee.yaml b/releasenotes/notes/0.12/CSPLayout_limit-e0643857e866d1ee.yaml new file mode 100644 index 000000000000..99554f224cad --- /dev/null +++ b/releasenotes/notes/0.12/CSPLayout_limit-e0643857e866d1ee.yaml @@ -0,0 +1,10 @@ +--- +features: + - | + The pass :class:`qiskit.transpiler.passes.CSPLayout` was extended with two + new parameters: ``call_limit`` and ``time_limit``. These options allow to + limit how long this pass will run. The option ``call_limit`` limits the + amount of time that the recursive function in the backtracking solver is + called. Similarly, ``call_limit`` limits how long (in seconds) the solver + will be running. The defaults are ``1000`` calls and ``10`` seconds + respectively. diff --git a/releasenotes/notes/0.12/acquire-single-channel-ea83cef8d991f945.yaml b/releasenotes/notes/0.12/acquire-single-channel-ea83cef8d991f945.yaml new file mode 100644 index 000000000000..2040977ab940 --- /dev/null +++ b/releasenotes/notes/0.12/acquire-single-channel-ea83cef8d991f945.yaml @@ -0,0 +1,20 @@ +--- +features: + - | + :class:`qiskit.pulse.Acquire` can now be applied to a single qubit. + This makes pulse programming more consistent and easier to reason + about, as now all operations in now apply to a single channel. + For example:: + + acquire = Acquire(duration=10) + schedule = Schedule() + schedule.insert(60, acquire(AcquireChannel(0), MemorySlot(0), RegisterSlot(0))) + schedule.insert(60, acquire(AcquireChannel(1), MemorySlot(1), RegisterSlot(1))) + +deprecations: + - | + Running :class:`qiskit.pulse.Acquire` on multiple qubits has been + deprecated and will be removed in a future release. Additionally, the + :class:`qiskit.pulse.AcquireInstruction` parameters ``mem_slots`` and + ``reg_slots`` have been deprecated. Instead ``reg_slot`` and ``mem_slot`` + should be used instead. diff --git a/releasenotes/notes/0.12/add-couplingmap-draw-45b8750065719e2c.yaml b/releasenotes/notes/0.12/add-couplingmap-draw-45b8750065719e2c.yaml new file mode 100644 index 000000000000..7e0677498338 --- /dev/null +++ b/releasenotes/notes/0.12/add-couplingmap-draw-45b8750065719e2c.yaml @@ -0,0 +1,15 @@ +--- +features: + - | + A new method :meth:`qiskit.transpiler.CouplingMap.draw` was added to + :class:`qiskit.transpiler.CouplingMap` to generate a graphviz images from + the coupling map graph. For example: + + .. jupyter-execute:: + + from qiskit.transpiler import CouplingMap + + + coupling_map = CouplingMap( + [[0, 1], [1, 0], [1, 2], [1, 3], [2, 1], [3, 1], [3, 4], [4, 3]]) + coupling_map.draw() diff --git a/releasenotes/notes/0.12/add-parametric-pulses-51184457faf31053.yaml b/releasenotes/notes/0.12/add-parametric-pulses-51184457faf31053.yaml new file mode 100644 index 000000000000..1fbeb3f1731c --- /dev/null +++ b/releasenotes/notes/0.12/add-parametric-pulses-51184457faf31053.yaml @@ -0,0 +1,51 @@ +--- +features: + - | + Parametric pulses have been added to OpenPulse. These are pulse commands + which are parameterized and understood by the backend. Arbitrary pulse + shapes are still supported by the SamplePulse Command. The new supported + pulse classes are: + + - :class:`qiskit.pulse.ConstantPulse` + - :class:`qiskit.pulse.Drag` + - :class:`qiskit.pulse.Gaussian` + - :class:`qiskit.pulse.GaussianSquare` + + They can be used like any other Pulse command. An example:: + + from qiskit.pulse import (Schedule, Gaussian, Drag, ConstantPulse, + GaussianSquare) + + sched = Schedule(name='parametric_demo') + sched += Gaussian(duration=25, sigma=4, amp=0.5j)(DriveChannel(0)) + sched += Drag(duration=25, amp=0.1, sigma=5, beta=4)(DriveChannel(1)) + sched += ConstantPulse(duration=25, amp=0.3+0.1j)(DriveChannel(1)) + sched += GaussianSquare(duration=1500, amp=0.2, sigma=8, + width=140)(MeasureChannel(0)) << sched.duration + + The resulting schedule will be similar to a SamplePulse schedule built + using :mod:`qiskit.pulse.pulse_lib`, however, waveform sampling will be + performed by the backend. The method :meth:`qiskit.pulse.Schedule.draw` + can still be used as usual. However, the command will be converted to a + ``SamplePulse`` with the + :meth:`qiskit.pulse.ParametricPulse.get_sample_pulse` method, so the + pulse shown may not sample the continuous function the same way that the + backend will. + + This feature can be used to construct Pulse programs for any backend, but + the pulses will be converted to ``SamplePulse`` objects if the backend does + not support parametric pulses. Backends which support them will have the + following new attribute:: + + backend.configuration().parametric_pulses: List[str] + # e.g. ['gaussian', 'drag', 'constant'] + + Note that the backend does not need to support all of the parametric + pulses defined in Qiskit. + + When the backend supports parametric pulses, and the Pulse schedule is + built with them, the assembled Qobj is significantly smaller. The size + of a PulseQobj built entirely with parametric pulses is dependent only + on the number of instructions, whereas the size of a PulseQobj built + otherwise will grow with the duration of the instructions (since every + sample must be specified with a value). diff --git a/releasenotes/notes/add-utility-function-measure-4b951766cdfe5cd6.yaml b/releasenotes/notes/0.12/add-utility-function-measure-4b951766cdfe5cd6.yaml similarity index 64% rename from releasenotes/notes/add-utility-function-measure-4b951766cdfe5cd6.yaml rename to releasenotes/notes/0.12/add-utility-function-measure-4b951766cdfe5cd6.yaml index 99d4907b3f05..caa73f27971a 100644 --- a/releasenotes/notes/add-utility-function-measure-4b951766cdfe5cd6.yaml +++ b/releasenotes/notes/0.12/add-utility-function-measure-4b951766cdfe5cd6.yaml @@ -1,8 +1,10 @@ --- features: - | - Added utility functions - ``measure`` and ``measure_all`` in scheduler module to return a - ``Schedule`` which measures qubits using OpenPulse. For example:: + Added utility functions, :func:`qiskit.scheduler.measure` and + :func:`qiskit.scheduler.measure_all` to `qiskit.scheduler` module. These + functions return a :class:`qiskit.pulse.Schedule` object which measures + qubits using OpenPulse. For example:: from qiskit.scheduler import measure, measure_all diff --git a/releasenotes/notes/0.12/better-pulse-repr-9e5ba50649322b6b.yaml b/releasenotes/notes/0.12/better-pulse-repr-9e5ba50649322b6b.yaml new file mode 100644 index 000000000000..ccd067b24839 --- /dev/null +++ b/releasenotes/notes/0.12/better-pulse-repr-9e5ba50649322b6b.yaml @@ -0,0 +1,18 @@ +--- +features: + - | + Pulse :class:`qiskit.pulse.Schedule` objects now have better + representations that for simple schedules should be valid Python + expressions. + + for example: + + .. jupyter-execute:: + + from qiskit import pulse + + sched = pulse.Schedule(name='test') + sched += pulse.SamplePulse( + [0., 0,], name='test_pulse')(pulse.DriveChannel(0)) + sched += pulse.FrameChange(1.0)(pulse.DriveChannel(0)) + print(sched) diff --git a/releasenotes/notes/0.12/better_support_for_controlled_gates_in_text_drawer-b18cff47d64271ef.yaml b/releasenotes/notes/0.12/better_support_for_controlled_gates_in_text_drawer-b18cff47d64271ef.yaml new file mode 100644 index 000000000000..b13a528e6152 --- /dev/null +++ b/releasenotes/notes/0.12/better_support_for_controlled_gates_in_text_drawer-b18cff47d64271ef.yaml @@ -0,0 +1,10 @@ +--- +fixes: + - | + All the output types for the circuit drawers in + :meth:`qiskit.circuit.QuantumCircuit.draw` and + :func:`qiskit.visualization.circuit_drawer` have fixed and/or improved + support for drawing controlled custom gates. Fixes + `issue #3546 `_, + `issue #3763 `_, + and `issue #3764 `_ diff --git a/releasenotes/notes/0.12/change-rep-time-unit-48533d8fe474a035.yaml b/releasenotes/notes/0.12/change-rep-time-unit-48533d8fe474a035.yaml new file mode 100644 index 000000000000..933917d72c24 --- /dev/null +++ b/releasenotes/notes/0.12/change-rep-time-unit-48533d8fe474a035.yaml @@ -0,0 +1,12 @@ +upgrade: + - | + The value of the ``rep_time`` parameter for Pulse backend's configuration + object are now in units of seconds, not microseconds. The first time a + ``PulseBackendConfiguration`` object is initialized it will raise a single + warning to the user to indicate this. + - | + The ``rep_time`` argument for :func:`qiskit.compiler.assemble` now takes + in a value in units of seconds, not microseconds. This was done to make + the units with everything else in pulse. If you were passing in a value for + ``rep_time`` ensure that you update the value to account for this change. + diff --git a/releasenotes/notes/0.12/circuit_instruction_map-rename-d011d5cc34d16b7b.yaml b/releasenotes/notes/0.12/circuit_instruction_map-rename-d011d5cc34d16b7b.yaml new file mode 100644 index 000000000000..014db3ba42f3 --- /dev/null +++ b/releasenotes/notes/0.12/circuit_instruction_map-rename-d011d5cc34d16b7b.yaml @@ -0,0 +1,8 @@ +--- +deprecations: + - | + The attribute of the :class:`qiskit.providers.models.PulseDefaults` class + ``circuit_instruction_map`` has been deprecated and will be removed in a + future release. Instead you should use the new attribute + ``instruction_schedule_map``. This was done to match the type of the + value of the attribute, which is an ``InstructionScheduleMap``. diff --git a/releasenotes/notes/0.12/controlled-gate-api-changes-da5781ef1ae5e971.yaml b/releasenotes/notes/0.12/controlled-gate-api-changes-da5781ef1ae5e971.yaml new file mode 100644 index 000000000000..88229fae3c1a --- /dev/null +++ b/releasenotes/notes/0.12/controlled-gate-api-changes-da5781ef1ae5e971.yaml @@ -0,0 +1,17 @@ +--- +upgrade: + - | + The value of the ``base_gate`` property of + :class:`qiskit.circuit.ControlledGate` objects has been changed from the + class of the base gate to an instance of the class of the base gate. + - | + The ``base_gate_name`` property of :class:`qiskit.circuit.ControlledGate` + has been removed, you can get the name of the base gate by either accessing + ``base_gate.name`` on the object. For example:: + + from qiskit import QuantumCircuit + from qiskit.extensions import HGate + + qc = QuantumCircuit(3) + cch_gate = HGate().control(2) + base_gate_name = cch_gate.base_gate.name diff --git a/releasenotes/notes/0.12/copy-measure-methods-562f0c1096f93145.yaml b/releasenotes/notes/0.12/copy-measure-methods-562f0c1096f93145.yaml new file mode 100644 index 000000000000..3a91555e33fa --- /dev/null +++ b/releasenotes/notes/0.12/copy-measure-methods-562f0c1096f93145.yaml @@ -0,0 +1,11 @@ +--- +features: + - | + The :class:`qiskit.circuit.QuantumCircuit` methods + :meth:`qiskit.circuit.QuantumCircuit.measure_active`, + :meth:`qiskit.circuit.QuantumCircuit.measure_all`, and + :meth:`qiskit.circuit.QuantumCircuit.remove_final_measurements` now have + an addition kwarg ``inplace``. When ``inplace`` is set to ``False`` the + function will return a modified **copy** of the circuit. This is different + from the default behavior which will modify the circuit object in-place and + return nothing. diff --git a/releasenotes/notes/0.12/coupling-map-constructors-d9f66ac45f4ceb1b.yaml b/releasenotes/notes/0.12/coupling-map-constructors-d9f66ac45f4ceb1b.yaml new file mode 100644 index 000000000000..bdabee8f6e44 --- /dev/null +++ b/releasenotes/notes/0.12/coupling-map-constructors-d9f66ac45f4ceb1b.yaml @@ -0,0 +1,21 @@ +--- +features: + - | + Several new constructor methods were added to the + :class:`qiskit.transpiler.CouplingMap` class for building objects + with basic qubit coupling graphs. The new constructor methods are: + + - :meth:`qiskit.transpiler.CouplingMap.from_full` + - :meth:`qiskit.transpiler.CouplingMap.from_line` + - :meth:`qiskit.transpiler.CouplingMap.from_ring` + - :meth:`qiskit.transpiler.CouplingMap.from_grid` + + For example, to use the new constructors to get a coupling map of 5 + qubits connected in a linear chain you can now run: + + .. jupyter-execute:: + + from qiskit.transpiler import CouplingMap + + coupling_map = CouplingMap.from_line(5) + coupling_map.draw() diff --git a/releasenotes/notes/0.12/crosstalk-adaptive-scheduling-2e08f213053c8f17.yaml b/releasenotes/notes/0.12/crosstalk-adaptive-scheduling-2e08f213053c8f17.yaml new file mode 100644 index 000000000000..0fcc8005dde1 --- /dev/null +++ b/releasenotes/notes/0.12/crosstalk-adaptive-scheduling-2e08f213053c8f17.yaml @@ -0,0 +1,35 @@ +--- +features: + - | + Introduced a new pass + :class:`qiskit.transpiler.passes.CrosstalkAdaptiveSchedule`.This pass + aims to reduce the impact of crosstalk noise on a program. It uses + crosstalk characterization data from the backend to schedule gates. + When a pair of gates has high crosstalk, they get serialized using a + barrier. Naive serialization is harmful because it incurs decoherence + errors. Hence, this pass uses a SMT optimization approach to compute a + schedule which minimizes the impact of crosstalk as well as decoherence + errors. + + The pass takes as input a circuit which is already transpiled onto + the backend i.e., the circuit is expressed in terms of physical qubits and + swap gates have been inserted and decomposed into CNOTs if required. Using + this circuit and crosstalk characterization data, a + `Z3 optimization `_ is used to construct a + new scheduled circuit as output. + + To use the pass on a circuit circ:: + + dag = circuit_to_dag(circ) + pass_ = CrosstalkAdaptiveSchedule(backend_prop, crosstalk_prop) + scheduled_dag = pass_.run(dag) + scheduled_circ = dag_to_circuit(scheduled_dag) + + ``backend_prop`` is a :class:`qiskit.providers.models.BackendProperties` + object for the target backend. ``crosstalk_prop`` is a dict which specifies + conditional error rates. For two gates ``g1`` and ``g2``, + ``crosstalk_prop[g1][g2]`` specifies the conditional error rate of ``g1`` + when ``g1`` and ``g2`` are executed simultaneously. A method for generating + ``crosstalk_prop`` will be added in a future release of qiskit-ignis. Until + then you'll either have to already know the crosstalk properties of your + device, or manually write your own device characterization experiments. diff --git a/releasenotes/notes/deprecate-persistent-value-command-4ec516a314197887.yaml b/releasenotes/notes/0.12/deprecate-persistent-value-command-4ec516a314197887.yaml similarity index 64% rename from releasenotes/notes/deprecate-persistent-value-command-4ec516a314197887.yaml rename to releasenotes/notes/0.12/deprecate-persistent-value-command-4ec516a314197887.yaml index 60e62e3daa20..96a8e7fe7f13 100644 --- a/releasenotes/notes/deprecate-persistent-value-command-4ec516a314197887.yaml +++ b/releasenotes/notes/0.12/deprecate-persistent-value-command-4ec516a314197887.yaml @@ -1,9 +1,10 @@ --- deprecations: - | - The PersistentValue command is deprecated from Qiskit Pulse. Similar - functionality can be achieved with the ConstantPulse command (one of - the new parametric pulses). Compare the following: + The :class:`qiskit.pulse.PersistentValue` command is deprecated and will + be removed in a future release. Similar functionality can be achieved with + the :class:`qiskit.pulse.ConstantPulse` command (one of the new parametric + pulses). Compare the following:: from qiskit.pulse import Schedule, PersistentValue, ConstantPulse, \ DriveChannel diff --git a/releasenotes/notes/deprecate-python-3.5-5bc0aadebc79d6b5.yaml b/releasenotes/notes/0.12/deprecate-python-3.5-5bc0aadebc79d6b5.yaml similarity index 78% rename from releasenotes/notes/deprecate-python-3.5-5bc0aadebc79d6b5.yaml rename to releasenotes/notes/0.12/deprecate-python-3.5-5bc0aadebc79d6b5.yaml index be54a856c651..ae2cd86499b0 100644 --- a/releasenotes/notes/deprecate-python-3.5-5bc0aadebc79d6b5.yaml +++ b/releasenotes/notes/0.12/deprecate-python-3.5-5bc0aadebc79d6b5.yaml @@ -1,14 +1,14 @@ --- issues: - | - Running functions that use ``qiskit.tools.parallel_map()`` (for example - ``qiskit.execute``, ``qiskit.transpile``, and - ``qiskit.transpiler.passmanager.PassManager.run()``) may not work when + Running functions that use :func:`qiskit.tools.parallel_map` (for example + :func:`qiskit.execute.execute`, :func:`qiskit.compiler.transpile`, and + :meth:`qiskit.transpiler.PassManager.run`) may not work when called from a script running outside of a ``if __name__ == '__main__':`` block when using Python 3.8 on MacOS. Other environments are uneffected by this issue. This is due to changes in how parallel processes are launched - by Python 3.8 on MacOS. If ``RuntimeError`` or ``AttributeError`` are raised - by scripts that are directly calling ``parallel_map()`` or when + by Python 3.8 on MacOS. If ``RuntimeError`` or ``AttributeError`` are + raised by scripts that are directly calling ``parallel_map()`` or when calling a function that uses it internally with Python 3.8 on MacOS embedding the script calls inside ``if __name__ == '__main__':`` should workaround the issue. For example:: @@ -50,5 +50,5 @@ issues: deprecations: - | Python 3.5 support in qiskit-terra is deprecated. Support will be - removed on the upstream python community's end of life date for the version, - which is 09/13/2020. + removed in the first release after the upstream Python community's end of + life date for the version, which is 09/13/2020. diff --git a/releasenotes/notes/0.12/fix3400_quantum_methods-e822a1247329f927.yaml b/releasenotes/notes/0.12/fix3400_quantum_methods-e822a1247329f927.yaml new file mode 100644 index 000000000000..3381029df624 --- /dev/null +++ b/releasenotes/notes/0.12/fix3400_quantum_methods-e822a1247329f927.yaml @@ -0,0 +1,32 @@ +--- +fixes: + - | + Explanation and examples have been added to documentation for the + :class:`qiskit.circuit.QuantumCircuit` methods for adding gates: + :meth:`qiskit.circuit.QuantumCircuit.ccx`, + :meth:`qiskit.circuit.QuantumCircuit.ch`, + :meth:`qiskit.circuit.QuantumCircuit.crz`, + :meth:`qiskit.circuit.QuantumCircuit.cswap`, + :meth:`qiskit.circuit.QuantumCircuit.cu1`, + :meth:`qiskit.circuit.QuantumCircuit.cu3`, + :meth:`qiskit.circuit.QuantumCircuit.cx`, + :meth:`qiskit.circuit.QuantumCircuit.cy`, + :meth:`qiskit.circuit.QuantumCircuit.cz`, + :meth:`qiskit.circuit.QuantumCircuit.h`, + :meth:`qiskit.circuit.QuantumCircuit.iden`, + :meth:`qiskit.circuit.QuantumCircuit.rx`, + :meth:`qiskit.circuit.QuantumCircuit.ry`, + :meth:`qiskit.circuit.QuantumCircuit.rz`, + :meth:`qiskit.circuit.QuantumCircuit.s`, + :meth:`qiskit.circuit.QuantumCircuit.sdg`, + :meth:`qiskit.circuit.QuantumCircuit.swap`, + :meth:`qiskit.circuit.QuantumCircuit.t`, + :meth:`qiskit.circuit.QuantumCircuit.tdg`, + :meth:`qiskit.circuit.QuantumCircuit.u1`, + :meth:`qiskit.circuit.QuantumCircuit.u2`, + :meth:`qiskit.circuit.QuantumCircuit.u3`, + :meth:`qiskit.circuit.QuantumCircuit.x`, + :meth:`qiskit.circuit.QuantumCircuit.y`, + :meth:`qiskit.circuit.QuantumCircuit.z`. Fixes + `issue #3400 `_ + diff --git a/releasenotes/notes/0.12/fix3640-70e912031815d09a.yaml b/releasenotes/notes/0.12/fix3640-70e912031815d09a.yaml new file mode 100644 index 000000000000..57d168ce6499 --- /dev/null +++ b/releasenotes/notes/0.12/fix3640-70e912031815d09a.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Fixes for handling of complex number parameter in circuit visualization. + Fixes `issue #3640 `_ diff --git a/releasenotes/notes/0.12/level1_trivial_dense_layout-7b6be7221b18af0c.yaml b/releasenotes/notes/0.12/level1_trivial_dense_layout-7b6be7221b18af0c.yaml new file mode 100644 index 000000000000..34d9abc66945 --- /dev/null +++ b/releasenotes/notes/0.12/level1_trivial_dense_layout-7b6be7221b18af0c.yaml @@ -0,0 +1,9 @@ +--- +features: + - | + In the preset pass manager for optimization level 1, + :func:`qiskit.transpiler.preset_passmanagers.level_1_pass_manager` if + :class:`qiskit.transpiler.passes.TrivialLayout` layout pass is not a + perfect match for a particular circuit, then + :class:`qiskit.transpiler.passes.DenseLayout` layout pass is used + instead. diff --git a/releasenotes/notes/0.12/operator-dot-fd90e7e5ad99ff9b.yaml b/releasenotes/notes/0.12/operator-dot-fd90e7e5ad99ff9b.yaml new file mode 100644 index 000000000000..9dd4a241a09d --- /dev/null +++ b/releasenotes/notes/0.12/operator-dot-fd90e7e5ad99ff9b.yaml @@ -0,0 +1,25 @@ +--- +features: + - | + Added a new abstract method + :meth:`qiskit.quantum_info.Operator.dot` to + the abstract ``BaseOperator`` class, so it is included for all + implementations of that abstract + class, including :class:`qiskit.quantum_info.Operator` and + ``QuantumChannel`` (e.g., :class:`qiskit.quantum_info.Choi`) + objects. This method returns the right operator multiplication + ``a.dot(b)`` :math:`= a \cdot b`. This is equivalent to + calling the operator + :meth:`qiskit.quantum_info.Operator.compose` method with the kwarg + ``front`` set to ``True``. +upgrade: + - | + Changed :class:`qiskit.quantum_info.Operator` magic methods so that + ``__mul__`` (which gets executed by python's multiplication operation, + if the left hand side of the operation has it defined) implements right + matrix multiplication (i.e. :meth:`qiskit.quantum_info.Operator.dot`), and + ``__rmul__`` (which gets executed by python's multiplication operation + from the right hand side of the operation if the left does not have + ``__mul__`` defined) implements scalar multiplication (i.e. + :meth:`qiskit.quantum_info.Operator.multiply`). Previously both methods + implemented scalar multiplciation. diff --git a/releasenotes/notes/0.12/opertor-measures-33682f22a4c58d68.yaml b/releasenotes/notes/0.12/opertor-measures-33682f22a4c58d68.yaml new file mode 100644 index 000000000000..fbd004894bd2 --- /dev/null +++ b/releasenotes/notes/0.12/opertor-measures-33682f22a4c58d68.yaml @@ -0,0 +1,20 @@ +--- +features: + - | + Added :func:`qiskit.quantum_info.average_gate_fidelity` and + :func:`qiskit.quantum_info.gate_error` functions to the + :mod:`qiskit.quantum_info` module for working with + :class:`qiskit.quantum_info.Operator` and ``QuantumChannel`` + (e.g., :class:`qiskit.quantum_info.Choi`) objects. +upgrade: + - | + The second argument of the :func:`qiskit.quantum_info.process_fidelity` + function, ``target``, is now optional. If a target unitary is not + specified, then process fidelity of the input channel with the identity + operator will be returned. +deprecations: + - | + The ``require_cptp`` kwarg of the + :func:`qiskit.quantum_info.process_fidelity` function has been + deprecated and will be removed in a future release. It is superseded by + two separate kwargs ``require_cp`` and ``require_tp``. diff --git a/releasenotes/notes/0.12/output-first-arg-drawer-9b162196da72cb8f.yaml b/releasenotes/notes/0.12/output-first-arg-drawer-9b162196da72cb8f.yaml new file mode 100644 index 000000000000..e83cc75da7e8 --- /dev/null +++ b/releasenotes/notes/0.12/output-first-arg-drawer-9b162196da72cb8f.yaml @@ -0,0 +1,8 @@ +--- +deprecations: + - | + Setting the ``scale`` parameter for + :meth:`qiskit.circuit.QuantumCircuit.draw` and + :func:`qiskit.visualization.circuit_drawer` as the first positional + argument is deprecated and will be removed in a future release. Instead you + should use ``scale`` as keyword argument. diff --git a/releasenotes/notes/0.12/partial-trace-87fd0ef50196a308.yaml b/releasenotes/notes/0.12/partial-trace-87fd0ef50196a308.yaml new file mode 100644 index 000000000000..da0b8750392b --- /dev/null +++ b/releasenotes/notes/0.12/partial-trace-87fd0ef50196a308.yaml @@ -0,0 +1,17 @@ +--- +features: + - | + Added the :func:`qiskit.quantum_info.partial_trace` function to the + :mod:`qiskit.quantum_info` that works with + :class:`qiskit.quantum_info.Statevector` and + :class:`qiskit.quantum_info.DensityMatrix` quantum state classes. + For example:: + + from qiskit.quantum_info.states import Statevector + from qiskit.quantum_info.states import DensityMatrix + from qiskit.quantum_info.states import partial_trace + + psi = Statevector.from_label('10+') + partial_trace(psi, [0, 1]) + rho = DensityMatrix.from_label('10+') + partial_trace(rho, [0, 1]) diff --git a/releasenotes/notes/0.12/physical-qubits-as-integers-86b999bcfe0098dd.yaml b/releasenotes/notes/0.12/physical-qubits-as-integers-86b999bcfe0098dd.yaml new file mode 100644 index 000000000000..392373fc3c1f --- /dev/null +++ b/releasenotes/notes/0.12/physical-qubits-as-integers-86b999bcfe0098dd.yaml @@ -0,0 +1,23 @@ +--- +features: + - | + When :meth:`qiskit.circuit.QuantumCircuit.draw` or + :func:`qiskit.visualization.circuit_drawer` is called with the + ``with_layout`` kwarg set True (the default) the output visualization + will now display the physical qubits as integers to clearly + distinguish them from the virtual qubits. + + For Example: + + .. jupyter-execute:: + + from qiskit import QuantumCircuit + from qiskit import transpile + from qiskit.test.mock import FakeVigo + + qc = QuantumCircuit(3) + qc.h(0) + qc.cx(0, 1) + qc.cx(0, 2) + transpiled_qc = transpile(qc, FakeVigo()) + transpiled_qc.draw(output='mpl') diff --git a/releasenotes/notes/0.12/reorganization-of-transpiler-passes-8758ad4130638534.yaml b/releasenotes/notes/0.12/reorganization-of-transpiler-passes-8758ad4130638534.yaml new file mode 100644 index 000000000000..18ea44a40d4e --- /dev/null +++ b/releasenotes/notes/0.12/reorganization-of-transpiler-passes-8758ad4130638534.yaml @@ -0,0 +1,7 @@ +--- +other: + - | + The transpiler passes in the :mod:`qiskit.transpiler.passes` directory hav + been organized into subdirectories to better categorize them by + functionality. They are still all accessible under the + ``qiskit.transpiler.passes`` namespace. diff --git a/releasenotes/notes/0.12/respect-max-shots-a6f8ac0d88040f42.yaml b/releasenotes/notes/0.12/respect-max-shots-a6f8ac0d88040f42.yaml new file mode 100644 index 000000000000..aa8f7316ffb5 --- /dev/null +++ b/releasenotes/notes/0.12/respect-max-shots-a6f8ac0d88040f42.yaml @@ -0,0 +1,9 @@ +--- +upgrade: + - | + :func:`qiskit.compiler.assemble` will now respect the configured + ``max_shots`` value for a backend. If a value for the ``shots`` kwarg is + specified that exceed the max shots set in the backend configuration the + function will now raise a ``QiskitError`` exception. Additionally, if no + shots argument is provided the default value is either 1024 (the previous + behavior) or ``max_shots`` from the backend, whichever is lower. diff --git a/releasenotes/notes/0.12/state-measures-f662a847d0db42b8.yaml b/releasenotes/notes/0.12/state-measures-f662a847d0db42b8.yaml new file mode 100644 index 000000000000..97b98cc4b708 --- /dev/null +++ b/releasenotes/notes/0.12/state-measures-f662a847d0db42b8.yaml @@ -0,0 +1,59 @@ +--- +features: + - | + Added new state measure functions to the :mod:`qiskit.quantum_info` + module: :func:`qiskit.quantum_info.entropy`, + :func:`qiskit.quantum_info.mutual_information`, + :func:`qiskit.quantum_info.concurrence`, and + :func:`qiskit.quantum_info.entanglement_of_formation`. These functions work + with the :class:`qiskit.quantum_info.Statevector` and + :class:`qiskit.quantum_info.DensityMatrix` classes. + +deprecations: + - | + The :mod:`qiskit.tools.qi.qi` module is deprecated and will be removed in a + future release. The legacy functions in the module have all been superseded + by functions and classes in the :mod:`qiskit.quantum_info` module. A table + of the deprecated functions and their replacement are below: + + .. list-table:: ``qiskit.tools.qi.qi`` replacements + :header-rows: 1 + + * - Deprecated + - Replacement + * - :func:`qiskit.tools.partial_trace` + - :func:`qiskit.quantum_info.partial_trace` + * - :func:`qiskit.tools.choi_to_pauli` + - :class:`qiskit.quantum_info.Choi` and :class:`quantum_info.PTM` + * - :func:`qiskit.tools.chop` + - ``numpy.round`` + * - ``qiskit.tools.qi.qi.outer`` + - ``numpy.outer`` + * - :func:`qiskit.tools.concurrence` + - :func:`qiskit.quantum_info.concurrence` + * - :func:`qiskit.tools.shannon_entropy` + - :func:`qiskit.quantum_info.shannon_entropy` + * - :func:`qiskit.tools.entropy` + - :func:`qiskit.quantum_info.entropy` + * - :func:`qiskit.tools.mutual_information` + - :func:`qiskit.quantum_info.mutual_information` + * - :func:`qiskit.tools.entanglement_of_formation` + - :func:`qiskit.quantum_info.entanglement_of_formation` + * - :func:`qiskit.tools.is_pos_def` + - ``quantum_info.operators.predicates.is_positive_semidefinite_matrix`` + + - | + The :mod:`qiskit.quantum_info.states.states` module is deprecated and will + be removed in a future release. The legacy functions in the module have + all been superseded by functions and classes in the + :mod:`qiskit.quantum_info` module. + + .. list-table:: ``qiskit.quantum_info.states.states`` replacements + :header-rows: 1 + + * - Deprecated + - Replacement + * - ``qiskit.quantum_info.states.states.basis_state`` + - :meth:`qiskit.quantum_info.Statevector.from_label` + * - ``qiskit.quantum_info.states.states.projector`` + - :class:`qiskit.quantum_info.DensityMatrix` diff --git a/releasenotes/notes/0.12/update-scaling-draw-option-7f28e83ff3e3939f.yaml b/releasenotes/notes/0.12/update-scaling-draw-option-7f28e83ff3e3939f.yaml new file mode 100644 index 000000000000..200f862d82cc --- /dev/null +++ b/releasenotes/notes/0.12/update-scaling-draw-option-7f28e83ff3e3939f.yaml @@ -0,0 +1,18 @@ +--- +deprecations: + - | + The ``scaling`` parameter of the ``draw()`` method for the ``Schedule`` and + ``Pulse`` objects was deprecated and will be removed in a future release. + Instead the new ``scale`` parameter should be used. This was done to have + a consistent argument between pulse and circuit drawings. For example:: + + #The consistency in parameters is seen below + #For circuits + circuit = QuantumCircuit() + circuit.draw(scale=0.2) + #For pulses + pulse = SamplePulse() + pulse.draw(scale=0.2) + #For schedules + schedule = Schedule() + schedule.draw(scale=0.2) diff --git a/releasenotes/notes/0.12/zxz-decomposition-6f0c2a31c552584f.yaml b/releasenotes/notes/0.12/zxz-decomposition-6f0c2a31c552584f.yaml new file mode 100644 index 000000000000..03a2de8cdc9f --- /dev/null +++ b/releasenotes/notes/0.12/zxz-decomposition-6f0c2a31c552584f.yaml @@ -0,0 +1,9 @@ +--- +features: + - | + The decomposition methods for single-qubit gates in + :class:`qiskit.quantum_info.synthesis.one_qubit_decompose.OneQubitEulerDecomposer` have been expanded to now + also include the ``'ZXZ'`` basis, characterized by three rotations about + the Z,X,Z axis. This now means that a general 2x2 Operator can be + decomposed into following bases: ``U3``, ``U1X``, ``ZYZ``, ``ZXZ``, + ``XYX``, ``ZXZ``. diff --git a/releasenotes/notes/2482-decompose-does-not-propagate-bound-parameters-71fb409de3416255.yaml b/releasenotes/notes/2482-decompose-does-not-propagate-bound-parameters-71fb409de3416255.yaml deleted file mode 100644 index 8b62e301a681..000000000000 --- a/releasenotes/notes/2482-decompose-does-not-propagate-bound-parameters-71fb409de3416255.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -fixes: - - | - Previously, binding_parameters prior to decomposing a circuit would result in - the bind values not correctly being substituted into the decomposed gates. - This has been resolved such that binding and decomposition may occur in any order. diff --git a/releasenotes/notes/3399-Change-QuantumCircuit-method-input-arg-names-8422b6abfdfff081.yaml b/releasenotes/notes/3399-Change-QuantumCircuit-method-input-arg-names-8422b6abfdfff081.yaml deleted file mode 100644 index 131ff5eb7575..000000000000 --- a/releasenotes/notes/3399-Change-QuantumCircuit-method-input-arg-names-8422b6abfdfff081.yaml +++ /dev/null @@ -1,40 +0,0 @@ ---- -deprecations: - - | - Methods for adding gates to a `QuantumCircuit` with abbreviated keyword - arguments (e.g. `ctl`, `tgt`) have had their keyword arguments renamed - to be more descriptive (e.g. `control_qubit`, `target_qubit`). The old - names have been deprecated. A table including the old and new calling - signatures for the `QuantumCircuit` methods is included below. - - - | Instruction | Former | New | - | Type | Signature | Signature | - |----------------+-----------------------------------+-------------------------------------------------------| - | HGate | qc.h(q) | qc.h(qubit) | - | CHGate | qc.ch(ctl, tgt) | qc.ch(control_qubit, target_qubit) | - | IdGate | qc.iden(q) | qc.iden(qubit) | - | RGate | qc.r(theta, phi, q) | qc.r(theta, phi, qubit) | - | RXGate | qc.rx(theta, q) | qc.rx(theta, qubit) | - | CrxGate | qc.crx(theta, ctl, tgt) | qc.crx(theta, control_qubit, target_qubit) | - | RYGate | qc.ry(theta, q) | qc.ry(theta, qubit) | - | CryGate | qc.cry(theta, ctl, tgt) | qc.cry(theta, control_qubit, target_qubit) | - | RZGate | qc.rz(phi, q) | qc.rz(phi, qubit) | - | CrzGate | qc.crz(theta, ctl, tgt) | qc.crz(theta, control_qubit, target_qubit) | - | SGate | qc.s(q) | qc.s(qubit) | - | SdgGate | qc.sdg(q) | qc.sdg(qubit) | - | FredkinGate | qc.cswap(ctl, tgt1, tgt2) | qc.cswap(control_qubit, target_qubit1, target_qubit2) | - | TGate | qc.t(q) | qc.t(qubit) | - | TdgGate | qc.tdg(q) | qc.tdg(qubit) | - | U1Gate | qc.u1(theta, q) | qc.u1(theta, qubit) | - | Cu1Gate | qc.cu1(theta, ctl, tgt) | qc.cu1(theta, control_qubit, target_qubit) | - | U2Gate | qc.u2(phi, lam, q) | qc.u2(phi, lam, qubit) | - | U3Gate | qc.u3(theta, phi, lam, q) | qc.u3(theta, phi, lam, qubit) | - | Cu3Gate | qc.cu3(theta, phi, lam, ctl, tgt) | qc.cu3(theta, phi, lam, ctl, tgt) | - | XGate | qc.x(q) | qc.x(qubit) | - | CnotGate | qc.cx(ctl, tgt) | qc.cx(control_qubit, target_qubit) | - | ToffoliGate | qc.ccx(ctl1, ctl2, tgt) | qc.ccx(control_qubit1, control_qubit2, target_qubit) | - | YGate | qc.y(q) | qc.y(qubit) | - | CyGate | qc.cy(ctl, tgt) | qc.cy(control_qubit, target_qubit) | - | ZGate | qc.z(q) | qc.z(qubit) | - | CzGate | qc.cz(ctl, tgt) | qc.cz(control_qubit, target_qubit) | diff --git a/releasenotes/notes/CSPLayout_limit-e0643857e866d1ee.yaml b/releasenotes/notes/CSPLayout_limit-e0643857e866d1ee.yaml deleted file mode 100644 index 87f28705ae86..000000000000 --- a/releasenotes/notes/CSPLayout_limit-e0643857e866d1ee.yaml +++ /dev/null @@ -1,8 +0,0 @@ ---- -upgrade: - - | - The pass ``CSPLayout`` was extended with two new parameters: ``call_limit`` and ``time_limit``. - These options allow to limit how long this pass will run. The option ``call_limit`` limits the - amount of time that the recursive function in the backtracking solver is called. Similarly, - ``call_limit`` limits how long (in seconds) the solver will be running. The defaults - are ``1000`` calls and ``10`` seconds respectively. diff --git a/releasenotes/notes/acquire-single-channel-ea83cef8d991f945.yaml b/releasenotes/notes/acquire-single-channel-ea83cef8d991f945.yaml deleted file mode 100644 index 1e06260b69fa..000000000000 --- a/releasenotes/notes/acquire-single-channel-ea83cef8d991f945.yaml +++ /dev/null @@ -1,20 +0,0 @@ ---- -prelude: > - Acquire and AcquireInstruction now can be applied to a single channel -features: - - | - Within the terra API allow acquires be applied to a single qubit. - This makes pulse programming more consistent and easier to reason - about as all operations in pulse would then be for single channels. - For example: - - acquire = Acquire(duration=10) - schedule = Schedule() - schedule.insert(60, acquire(AcquireChannel(0), MemorySlot(0), RegisterSlot(0))) - schedule.insert(60, acquire(AcquireChannel(1), MemorySlot(1), RegisterSlot(1))) - -deprecations: - - | - Acquire on multiple qubits has been deprecated. - ``AcquireInstruction`` parameters ``mem_slots``, ``reg_slots`` has been deprecated, - use ``reg_slot``, ``mem_slot`` instead. diff --git a/releasenotes/notes/add-couplingmap-draw-45b8750065719e2c.yaml b/releasenotes/notes/add-couplingmap-draw-45b8750065719e2c.yaml deleted file mode 100644 index 3917598dcec6..000000000000 --- a/releasenotes/notes/add-couplingmap-draw-45b8750065719e2c.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -features: - - | - A ``draw`` method was added to ``qiskit.transpiler.CouplingMap`` to quickly - generate graphviz images from the coupling map graph. - diff --git a/releasenotes/notes/add-parametric-pulses-51184457faf31053.yaml b/releasenotes/notes/add-parametric-pulses-51184457faf31053.yaml deleted file mode 100644 index 8ab424fca437..000000000000 --- a/releasenotes/notes/add-parametric-pulses-51184457faf31053.yaml +++ /dev/null @@ -1,67 +0,0 @@ ---- -prelude: > - OpenPulse now supports four parametric pulses: Gaussian, GaussianSquare, - Drag, and ConstantPulse. These are Pulse commands which take parameters - rather than sample points to describe a pulse. They can be played on - channels and added to schedules exactly like other commands. This creates - a more consistent interface for adding commands from the pulse_lib, and - dramatically reduces the size of assembled pulse-Qobjs when the backend - supports parametric pulses. -features: - - | - Parametric pulses have been added to OpenPulse. These are pulse commands - which are parameterized and understood by the backend. Arbitrary pulse shapes are - still supported by the SamplePulse Command. The new supported pulses are: - - - ConstantPulse - - Drag - - Gaussian - - GaussianSquare - - They can be used like any other Pulse command. An example: - - from qiskit.pulse import (Schedule, Gaussian, Drag, ConstantPulse, - GaussianSquare) - - sched = Schedule(name='parametric_demo') - sched += Gaussian(duration=25, sigma=4, amp=0.5j)(DriveChannel(0)) - sched += Drag(duration=25, amp=0.1, sigma=5, beta=4)(DriveChannel(1)) - sched += ConstantPulse(duration=25, amp=0.3+0.1j)(DriveChannel(1)) - sched += GaussianSquare(duration=1500, amp=0.2, sigma=8, - width=140)(MeasureChannel(0)) << sched.duration - - The resulting schedule will be similar to a SamplePulse schedule built - using `pulse.pulse_lib`, however, waveform sampling will be performed by the - backend. The method `sched.draw()` can still be used as usual. However, the - command will be converted to a SamplePulse with the `get_sample_pulse` - method, so the pulse shown may not sample the continuous function the same - way that the backend will. - - This feature can be used to construct Pulse programs for any backend, but - the pulses will be converted to `SamplePulse`s if the backend does not - support parametric pulses. Backends which support them will have the - following new attribute: - - backend.configuration().parametric_pulses: List[str] - # e.g. ['gaussian', 'drag', 'constant'] - - Note that the backend does not need to support all of the parametric - pulses defined in Qiskit. - - When the backend supports parametric pulses, and the Pulse schedule is - built with them, the assembled Qobj is significantly smaller. The size - of a PulseQobj built entirely with parametric pulses is dependent only - on the number of instructions, whereas the size of a PulseQobj built - otherwise will grow with the duration of the instructions (since every - sample must be specified with a value). - - New parametric pulses can easily be added. The new command must implement - a `get_sample_pulse` method to convert itself to a SamplePulse (for drawing - and to assemble to backends which do not support it). It should be added - to `qiskit/pulse/commands/parametric_pulses.py`. - The new pulse must then be registered by the assembler in - `qiskit/qobj/converters/pulse_instruction.py:ParametricPulseShapes` - by following the existing pattern: - class ParametricPulseShapes(Enum): - ... - backend_config_pulse_str = commands.YourPulseCommandClass diff --git a/releasenotes/notes/better-pulse-repr-9e5ba50649322b6b.yaml b/releasenotes/notes/better-pulse-repr-9e5ba50649322b6b.yaml deleted file mode 100644 index 609bb6504701..000000000000 --- a/releasenotes/notes/better-pulse-repr-9e5ba50649322b6b.yaml +++ /dev/null @@ -1,15 +0,0 @@ ---- -features: - - | - Pulse `Schedule`s now have better representations that should for simple - schedules be valid Python expressions. - - for example:: - sched = pulse.Schedule(name='test') - sched += pulse.SamplePulse([0., 0,], name='test_pulse')(pulse.DriveChannel(0)) - sched += pulse.FrameChange(1.0)(pulse.DriveChannel(0)) - print(sched) - >>> Schedule((0, PulseInstruction(SamplePulse(samples=array([0.+0.j, 0.+0.j]), - name="test_pulse"), DriveChannel(0))), - (2, FrameChangeInstruction(FrameChange(phase=1.000, name="fc0"), - DriveChannel(0))), name="test") diff --git a/releasenotes/notes/better_support_for_controlled_gates_in_text_drawer-b18cff47d64271ef.yaml b/releasenotes/notes/better_support_for_controlled_gates_in_text_drawer-b18cff47d64271ef.yaml deleted file mode 100644 index a58a79ced5dc..000000000000 --- a/releasenotes/notes/better_support_for_controlled_gates_in_text_drawer-b18cff47d64271ef.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -fixes: - - | - Support for text-drawing controlled custom gates is significantly improved. diff --git a/releasenotes/notes/change-rep-time-unit-48533d8fe474a035.yaml b/releasenotes/notes/change-rep-time-unit-48533d8fe474a035.yaml deleted file mode 100644 index 2d568127b8a9..000000000000 --- a/releasenotes/notes/change-rep-time-unit-48533d8fe474a035.yaml +++ /dev/null @@ -1,10 +0,0 @@ -features: - - | - `assemble()` now takes `rep_time` in units of seconds, not microseconds. - `PulseBackendConfiguration._parse_pulse_args()` still takes `rep_times` in units of microseconds, - but they are now transformed to units of seconds before being passed to `assemble()` - At first pass, `PulseBackendConfiguration` will raise a warning to the user. -deprecations: - - | - `assemble()` now takes `rep_time` in units of seconds, not microseconds. - diff --git a/releasenotes/notes/circuit_instruction_map-rename-d011d5cc34d16b7b.yaml b/releasenotes/notes/circuit_instruction_map-rename-d011d5cc34d16b7b.yaml deleted file mode 100644 index 003561af1a4f..000000000000 --- a/releasenotes/notes/circuit_instruction_map-rename-d011d5cc34d16b7b.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -deprecations: - - | - The attribute of PulseDefaults, `circuit_instruction_map`, has been renamed - to `instruction_schedule_map`, to match the type of the attribute, which is - an InstructionScheduleMap. diff --git a/releasenotes/notes/copy-measure-methods-562f0c1096f93145.yaml b/releasenotes/notes/copy-measure-methods-562f0c1096f93145.yaml deleted file mode 100644 index 4e1c2bf71407..000000000000 --- a/releasenotes/notes/copy-measure-methods-562f0c1096f93145.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -upgrade: - - | - QuantumCircuit methods `measure_active`, `measure_all`, and - `remove_final_measurements` now take the `inplace` keyword - argument that, when, `False` return a modified copy of the - circuit. diff --git a/releasenotes/notes/coupling-map-constructors-d9f66ac45f4ceb1b.yaml b/releasenotes/notes/coupling-map-constructors-d9f66ac45f4ceb1b.yaml deleted file mode 100644 index 071e71a116e3..000000000000 --- a/releasenotes/notes/coupling-map-constructors-d9f66ac45f4ceb1b.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -features: - - | - The ``qiskit.transpiler.CouplingMap`` class now has constructors for basic - qubit coupling graphs. e.g. use ``CouplingMap.from_line(5)`` to get a - coupling of 5 qubits connected in a linear chain. diff --git a/releasenotes/notes/crosstalk-adaptive-scheduling-2e08f213053c8f17.yaml b/releasenotes/notes/crosstalk-adaptive-scheduling-2e08f213053c8f17.yaml deleted file mode 100644 index bdd7e5b378c4..000000000000 --- a/releasenotes/notes/crosstalk-adaptive-scheduling-2e08f213053c8f17.yaml +++ /dev/null @@ -1,27 +0,0 @@ ---- -features: - - | - Introduced a new CrosstalkAdaptiveSchedule pass. - This pass aims to reduce the impact of crosstalk noise on a program. It - uses crosstalk characterization data from the backend to schedule gates. - When a pair of gates has high crosstalk, they get serialized using a barrier. - Naive serialization is harmful because it incurs decoherence errors. - Hence, this pass uses a SMT optimization approach to compute a schedule which - minimizes the impact of crosstalk as well as decoherence errors. - - The pass takes as input a circuit which is already transpiled onto - the backend i.e., the circuit is expressed in terms of physical qubits and - swap gates have been inserted and decomposed into CNOTs if required. Using - this circuit and crosstalk characterization data, a Z3 optimization is used - to construct a new scheduled circuit as output. - - To use the pass on a circuit circ, - dag = circuit_to_dag(circ) - pass_ = CrosstalkAdaptiveSchedule(backend_prop, crosstalk_prop) - scheduled_dag = pass_.run(dag) - scheduled_circ = dag_to_circuit(scheduled_dag) - - backend_prop is a BackendProperties object for the target backend. - crosstalk_prop is a dict which specifies conditional error rates. - For two gates g1 and g2, crosstalk_prop[g1][g2] specifies the - conditional error rate of g1 when g1 and g2 are executed simultaneously. diff --git a/releasenotes/notes/fix3400_quantum_methods-e822a1247329f927.yaml b/releasenotes/notes/fix3400_quantum_methods-e822a1247329f927.yaml deleted file mode 100644 index 519db8b485a3..000000000000 --- a/releasenotes/notes/fix3400_quantum_methods-e822a1247329f927.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -fixes: - - | - Explanation and examples have been added to QuantumCircuit methods for these gates (ccx, ch, crz, cswap, cu1, cu3, cx, cy, cz, h, iden, rx, ry, rz, s, sdg, swap, t, tdg, u1, u2, u3, x, y, z). - Fixes `issue #3400 ` - diff --git a/releasenotes/notes/fix3640-70e912031815d09a.yaml b/releasenotes/notes/fix3640-70e912031815d09a.yaml deleted file mode 100644 index 5d14d498d483..000000000000 --- a/releasenotes/notes/fix3640-70e912031815d09a.yaml +++ /dev/null @@ -1,5 +0,0 @@ ---- -fixes: - - | - Fixes the circuit visualization to handle complex numbers. Fixes - `issue #3640 `_ diff --git a/releasenotes/notes/level1_trivial_dense_layout-7b6be7221b18af0c.yaml b/releasenotes/notes/level1_trivial_dense_layout-7b6be7221b18af0c.yaml deleted file mode 100644 index 2afaa51492fb..000000000000 --- a/releasenotes/notes/level1_trivial_dense_layout-7b6be7221b18af0c.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -features: - - | - In the transpiler optimization level 1, if trivial layout is - not a perfect match for a particular circuit, then dense - layout is used. diff --git a/releasenotes/notes/operator-dot-fd90e7e5ad99ff9b.yaml b/releasenotes/notes/operator-dot-fd90e7e5ad99ff9b.yaml deleted file mode 100644 index 75555a89e37a..000000000000 --- a/releasenotes/notes/operator-dot-fd90e7e5ad99ff9b.yaml +++ /dev/null @@ -1,12 +0,0 @@ ---- -features: - - | - Added ``dot`` as an abstract method to the ``BaseOperator`` class and hence - to ``Operator`` and ``QuantumChannel`` classes. This method returns the - right operator multiplication ``a.dot(b) = a * b``. It is equivalent to - calling the operator ``compose`` method with kwarg ``front=True``. -upgrade: - - | - Changed operator magic methods so that ``__mul__`` implements right matrix - multiplication ``dot``, and ``__rmul__`` implements scalar multiplication - ``multiply``. Previously both implemented scalar multiplciation. diff --git a/releasenotes/notes/opertor-measures-33682f22a4c58d68.yaml b/releasenotes/notes/opertor-measures-33682f22a4c58d68.yaml deleted file mode 100644 index e7b4cb21a032..000000000000 --- a/releasenotes/notes/opertor-measures-33682f22a4c58d68.yaml +++ /dev/null @@ -1,22 +0,0 @@ ---- -features: - - | - Added ``average_gate_fidelity`` and ``gate_error`` functions for - ``qiskit.quantum_info`` operator and quantum channel objects. -issues: - - | - List known issues here, or remove this section. All of the list items in - this section are combined when the release notes are rendered, so the text - needs to be worded so that it does not depend on any information only - available in another section, such as the prelude. This may mean repeating - some details. -upgrade: - - | - Changed second argument of ``process_fidelity`` function to be optional. - If a target unitary is not specified, the process fidelity of the input - channel with the identity operator will be returned. -deprecations: - - | - The ``require_cptp`` kwarg of the ``process_fidelity`` function has been - deprecated. It is superseded by two separate kwargs ``require_cp`` and - ``require_tp``. diff --git a/releasenotes/notes/output-first-arg-drawer-9b162196da72cb8f.yaml b/releasenotes/notes/output-first-arg-drawer-9b162196da72cb8f.yaml deleted file mode 100644 index 4356862900cb..000000000000 --- a/releasenotes/notes/output-first-arg-drawer-9b162196da72cb8f.yaml +++ /dev/null @@ -1,5 +0,0 @@ ---- -deprecations: - - | - Setting the 'scale' for `QuantumCircuit.draw()` as the first argument - is no supported. Use the `scale` keyword argument instead. diff --git a/releasenotes/notes/partial-trace-87fd0ef50196a308.yaml b/releasenotes/notes/partial-trace-87fd0ef50196a308.yaml deleted file mode 100644 index 54dcaf7dcc14..000000000000 --- a/releasenotes/notes/partial-trace-87fd0ef50196a308.yaml +++ /dev/null @@ -1,9 +0,0 @@ ---- -features: - - | - Added ``partial_trace`` function to ``qiskit.quantum_info`` that works with - ``Statevector`` and ``DensityMatrix`` quantum state classes. -deprecations: - - | - Deprecated ``qiskit.tools.qi.partial_trace`` function. Use the new function - ``qiskit.quantum_info.partial_trace`` instead. diff --git a/releasenotes/notes/physical-qubits-as-integers-86b999bcfe0098dd.yaml b/releasenotes/notes/physical-qubits-as-integers-86b999bcfe0098dd.yaml deleted file mode 100644 index 23112dec5dd0..000000000000 --- a/releasenotes/notes/physical-qubits-as-integers-86b999bcfe0098dd.yaml +++ /dev/null @@ -1,5 +0,0 @@ ---- -features: - - | - When a circuit is draw using ``with_layout``, the output will print the physical qubits - as integers to avoid the clearly distinguish them from the virtual qubits. diff --git a/releasenotes/notes/reorganization-of-transpiler-passes-8758ad4130638534.yaml b/releasenotes/notes/reorganization-of-transpiler-passes-8758ad4130638534.yaml deleted file mode 100644 index a4d436f542ed..000000000000 --- a/releasenotes/notes/reorganization-of-transpiler-passes-8758ad4130638534.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -other: - - | - The transpiler passes in the ``qiskit.transpiler.passes`` directory have been - organized into subdirectories to better categorize them by functionality. They - are still all accessible under the ``qiskit.transpiler.passes`` namespace. diff --git a/releasenotes/notes/respect-max-shots-a6f8ac0d88040f42.yaml b/releasenotes/notes/respect-max-shots-a6f8ac0d88040f42.yaml deleted file mode 100644 index e82e3b5422cc..000000000000 --- a/releasenotes/notes/respect-max-shots-a6f8ac0d88040f42.yaml +++ /dev/null @@ -1,8 +0,0 @@ ---- -upgrade: - - | - ``qiskit.compiler.assemble()`` will now respect the configured max_shots for - a backend. If shots are specified that exceed the max shots set in the - backend configuration this will now raise a ``QiskitError`` exception. - Additionally, if no shots argument is provided the default value is either - 1024 (the previous behavior) or ``max_shots``, whichever is lower. diff --git a/releasenotes/notes/state-measures-f662a847d0db42b8.yaml b/releasenotes/notes/state-measures-f662a847d0db42b8.yaml deleted file mode 100644 index 7cb1b274681d..000000000000 --- a/releasenotes/notes/state-measures-f662a847d0db42b8.yaml +++ /dev/null @@ -1,12 +0,0 @@ ---- -features: - - | - Add state measure functions to the ``quantum_info`` module for ``entropy``, - ``mutual_information``, ``concurrence``, and ``entanglement_of_formation``. - These functions work with the ``Statevector`` and ``DensityMatrix`` classes. - -deprecations: - - | - Deprecates everything in the legacy `tools.qi.qi.py` file, and - `quantum_info.states.states.py` file. These legacy functions have all been - superseded by functions and classes in the ``quantum_info`` module. diff --git a/releasenotes/notes/update-scaling-draw-option-7f28e83ff3e3939f.yaml b/releasenotes/notes/update-scaling-draw-option-7f28e83ff3e3939f.yaml deleted file mode 100644 index d3cdeb0ed22f..000000000000 --- a/releasenotes/notes/update-scaling-draw-option-7f28e83ff3e3939f.yaml +++ /dev/null @@ -1,22 +0,0 @@ ---- -deprecations: - - | - The "scaling" parameter of the Schedule and Pulse objects was deprecated - in favor of a new "scale" parameter to enable consistency with the "scale" - parameter for circuit drawings. - For example; - #The consistency in parameters is seen below - #For circuits - circuit = QuantumCircuit() - circuit.draw(scale=0.2) - #For pulses - pulse = SamplePulse() - pulse.draw(scale=0.2) - #For schedules - schedule = Schedule() - schedule.draw(scale=0.2) -other: - - | - The "scale" parameter takes the place of the "scaling" parameter for Pulse and - Schedule objects to enable setting of the visual scaling of the drawn waveform - amplitude. diff --git a/releasenotes/notes/zxz-decomposition-6f0c2a31c552584f.yaml b/releasenotes/notes/zxz-decomposition-6f0c2a31c552584f.yaml deleted file mode 100644 index f02fb4072385..000000000000 --- a/releasenotes/notes/zxz-decomposition-6f0c2a31c552584f.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -features: - - | - Expanded the decomposition methods for single-qubit gates to now also include the - 'ZXZ' basis, characterized by three rotations about the Z,X,Z axis. This now means - that a general 2x2 Operator can be decomposed into following bases. - 'U3', 'U1X', 'ZYZ', 'ZXZ', 'XYX', 'ZXZ'.