Deprecations¶
Pending deprecations¶
The
do_queue
keyword argument inqml.operation.Operator
is deprecated. This affects all child classes, such asOperation
,Observable
,SymbolicOp
and more. Instead of settingdo_queue=False
, use theqml.QueuingManager.stop_recording()
context.Deprecated in v0.31
Will be removed in v0.32
LieAlgebraOptimizer
is renamed. Please useRiemannianGradientOptimizer
instead.Deprecated in v0.31
Will be removed in v0.32
The
Operation.base_name
property is deprecated. Please useOperator.name
ortype(obj).__name__
instead.Still accessible in v0.31
Removed in v0.32
qml.math.reduced_dm
has been deprecated. Please useqml.math.reduce_dm
orqml.math.reduce_statevector
instead.Still accessible in v0.31
Removed in v0.32
The
qml.specs
dictionary will no longer support direct key access to certain keys. Instead these quantities can be accessed as fields of the newResources
object saved underspecs_dict["resources"]
:num_operations
will no longer be supported, usespecs_dict["resources"].num_gates
num_used_wires
will no longer be supported, usespecs_dict["resources"].num_wires
gate_types
will no longer be supported, usespecs_dict["resources"].gate_types
gate_sizes
will no longer be supported, usespecs_dict["resources"].gate_sizes
depth
will no longer be supported, usespecs_dict["resources"].depth
These keys are still accessible in v0.31 and will be removed in v0.32.
QuantumScript
’sname
keyword argument and property are deprecated. This also affectsQuantumTape
andOperationRecorder
.Deprecated in v0.31
Will be removed in v0.32
The
observables
argument inQubitDevice.statistics
is deprecated. Please usecircuit
instead. Using a list of observables inQubitDevice.statistics
is deprecated. Please use aQuantumTape
instead.Still accessible in v0.28, v0.29, v0.30
Will be removed in v0.31
qml.ExpvalCost
has been deprecated, and usage will now raise a warning.Deprecated in v0.24
Will be removed in v0.31
Instead, it is recommended to simply pass Hamiltonians to the
qml.expval
function inside QNodes:@qml.qnode(dev) def ansatz(params): some_qfunc(params) return qml.expval(Hamiltonian)
Completed deprecation cycles¶
The
qml.utils.sparse_hamiltonian
function is deprecated.~.Hamiltonian.sparse_matrix
should be used instead.Deprecated in v0.29
Removed in v0.31
The
collections
module has been deprecated.Deprecated in v0.29
Removed in v0.31
qml.op_sum`
is deprecated. Users should useqml.sum
instead.Deprecated in v0.29.
Removed in v0.31.
The argument
argnum
for gradient transforms using the Jax interface is replaced byargnums
.argnum
is automatically changed toargnums
for gradient transforms using JAX and a warning is raised in v0.30argnums
is the only option for gradient transforms using JAX in v0.31
Evolution
now adds a-1
to the input parameter. Beforehand, the minus sign was not included.Transition warning added in v0.29.
Updated to current behaviour in v0.30.
The
seed_recipes
argument inqml.classical_shadow
andqml.shadow_expval
has been removed. An argumentseed
which defaults toNone
can contain an integer with the wanted seed.Still accessible in v0.28, v0.29
Removed in v0.30
The
get_operation
tape method is updated to return the operation index as well, changing its signature.The new signature is available by changing the arg
return_op_index
toTrue
in v0.29The old signature is replaced with the new one in v0.30
The
grouping
module is removed. The functionality has been moved and reorganized in the newpauli
module underpauli/utils.py
orpauli/grouping/
.Still accessible in v0.27, v0.28, v0.29, v0.30
Will be removed in v0.31
The functions from
grouping/pauli.py
,grouping/transformations.py
andgrouping/utils.py
have been moved topauli/utils.py
. The remaining functions have been consolidated in thepauli/grouping/
directory.qml.VQECost
is removed.Deprecated in 0.13
Removed in 0.29
In-place inversion —
op.inv()
andop.inverse=value
— is deprecated. Please useqml.adjoint
orqml.pow
instead.Still accessible in v0.27 and v0.28
Removed in v0.29
Don’t use:
>>> v1 = qml.PauliX(0).inv() >>> v2 = qml.PauliX(0) >>> v2.inverse = True
Instead, use:
>>> qml.adjoint(qml.PauliX(0)) Adjoint(PauliX(wires=[0])) >>> qml.pow(qml.PauliX(0), -1) PauliX(wires=[0])**-1 >>> qml.pow(qml.PauliX(0), -1, lazy=False) PauliX(wires=[0]) >>> qml.PauliX(0) ** -1 PauliX(wires=[0])**-1
The
qml.utils.decompose_hamiltonian()
method is removed. Please useqml.pauli_decompose()
.Still accessible in v0.27
Removed in v0.28
qml.tape.get_active_tape
is deprecated. Please useqml.QueuingManager.active_context()
instead.Deprecated in v0.27
Removed in v0.28
qml.transforms.qcut.remap_tape_wires
is deprecated. Please useqml.map_wires
instead.Deprecated in v0.27
Removed in v0.28
QuantumTape.inv()
is deprecated. Please useQuantumTape.adjoint()
instead. This method returns a new tape instead of modifying itself in-place.Deprecated in v0.27
Removed in v0.28
qml.tape.stop_recording
andQuantumTape.stop_recording
are moved toqml.QueuingManager.stop_recording
Deprecated in v0.27
Removed in v0.28
QueuingContext
is renamedQueuingManager
.Deprecated name
QueuingContext
in v0.27Removed in v0.28
QueuingManager.safe_update_info
andAnnotateQueue.safe_update_info
are removed.Deprecated in v0.27
Removed in v0.28
ObservableReturnTypes
Sample
,Variance
,Expectation
,Probability
,State
, andMidMeasure
are moved tomeasurements
fromoperation
.Deprecated in v0.23
Removed in v0.27
The
qml.utils.expand
function is deprecated.qml.math.expand_matrix
should be used instead.Deprecated in v0.24
Removed in v0.27
The
qml.Operation.get_parameter_shift
method is removed. Use the methods of thegradients
module for general parameter-shift rules instead.Deprecated in v0.22
Removed in v0.28
qml.transforms.measurement_grouping
has been removed. Please useqml.transforms.hamiltonian_expand
instead.Deprecated in v0.28
Removed in v0.29
qml.transforms.make_tape
was previously deprecated, but there is no longer a plan to remove it. It no longer raises a warning, and the functionality is unchanged.Deprecated in v0.28
Un-deprecated in v0.29