cirq.interop.quirk.QuirkInputRotationOperation

Operates on target qubits in a way that varies based on an input qureg.

Inherits From: Operation

gate

qubits

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

Methods

controlled_by

View source

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

Args
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.

transform_qubits

View source

Returns the same operation, but with different qubits.

Args
qubit_map A function or a dict mapping each current qubit into a desired new qubit.

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

Raises
TypeError qubit_map was not a function or dict mapping qubits to qubits.

validate_args

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.

Args
qubits The new qids for the operation.

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

with_probability

View source

with_qubits

View source

Returns the same operation, but applied to different qubits.

Args
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.

with_tags

View source

Creates a new TaggedOperation, with this op and the specified tags.

This method can be used to attach meta-data to specific operations without affecting their functionality. The intended usage is to attach classes intended for this purpose or strings to mark operations for specific usage that will be recognized by consumers. Specific examples include ignoring this operation in optimization passes, hardware-specific functionality, or circuit diagram customizability.

Tags can be a list of any type of object that is useful to identify this operation as long as the type is hashable. If you wish the resulting operation to be eventually serialized into JSON, you should also restrict the operation to be JSON serializable.

Args
new_tags The tags to wrap this operation in.

__eq__

View source

__ne__

View source