A specific operation instance that has been identified with a set

Inherits From: Operation

of Tags for special processing. This can be initialized with Using Operation.with_tags(tag) or by TaggedOperation(op, tag).

Tags added can be of any type, but they should be Hashable in order to allow equality checking. If you wish to serialize operations into JSON, you should restrict yourself to only use objects that have a JSON serialization.

See Operation.with_tags() for more information on intended usage.



tags Returns a tuple of the operation's tags.
untagged Returns the underlying operation without any tags.



View source

Returns a controlled version of this operation. If no control_qubits are specified, returns self.

control_qubits Qubits to control the operation by. Required.
control_values For which control qubit values to apply the operation. A sequence of the same length as control_qubits where each entry is an integer (or set of integers) corresponding to the qubit value (or set of possible values) where that control is enabled. When all controls are enabled, the operation is applied. If unspecified, control values default to 1.


View source

Returns the same operation, but with different qubits.

func The function to use to turn each current qubit into a desired new qubit.

The receiving operation but with qubits transformed by the given function.


View source

Raises an exception if the qubits don't match this operation's qid shape.

Call this method from a subclass's with_qubits method.

qubits The new qids for the operation.

ValueError The operation had qids that don't match it's qid shape.


View source


View source

Returns the same operation, but applied to different qubits.

new_qubits The new qubits to apply the operation to. The order must exactly match the order of qubits returned from the operation's qubits property.


View source

Creates a new TaggedOperation with combined tags.

Overloads Operation.with_tags to create a new TaggedOperation that has the tags of this operation combined with the new_tags specified as the parameter.


View source


View source


View source


View source


View source