![]() |
An operation that phases the eigenstates of a Pauli string.
Inherits From: PauliStringGateOperation
, Operation
cirq.ops.PauliStringPhasor(
pauli_string: cirq.ops.PauliString
,
*,
exponent_neg: Union[int, float, sympy.Basic] = 1,
exponent_pos: Union[int, float, sympy.Basic] = 0
) -> None
The -1 eigenstates of the Pauli string will have their amplitude multiplied by e^(i pi exponent_neg) while +1 eigenstates of the Pauli string will have their amplitude multiplied by e^(i pi exponent_pos).
Args | |
---|---|
pauli_string
|
The PauliString defining the positive and negative eigenspaces that will be independently phased. |
exponent_neg
|
How much to phase vectors in the negative eigenspace, in the form of the t in (-1)t = exp(i pi t). |
exponent_pos
|
How much to phase vectors in the positive eigenspace, in the form of the t in (-1)t = exp(i pi t). |
Attributes | |
---|---|
exponent_relative
|
|
gate
|
|
qubits
|
|
tags
|
Returns a tuple of the operation's tags. |
untagged
|
Returns the underlying operation without any tags. |
Methods
can_merge_with
can_merge_with(
op: "PauliStringPhasor"
) -> bool
controlled_by
controlled_by(
control_values: Optional[Sequence[Union[int, Collection[int]]]] = None,
*control_qubits
) -> "cirq.Operation"
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.
|
equal_up_to_global_phase
equal_up_to_global_phase(
other
)
map_qubits
map_qubits(
qubit_map: Dict[cirq.ops.Qid
, cirq.ops.Qid
]
)
Return an equivalent operation on new qubits with its Pauli string mapped to new qubits.
new_pauli_string = self.pauli_string.map_qubits(qubit_map)
merged_with
merged_with(
op: "PauliStringPhasor"
) -> "PauliStringPhasor"
pass_operations_over
pass_operations_over(
ops: Iterable[cirq.ops.Operation
],
after_to_before: bool = False
) -> "PauliStringPhasor"
transform_qubits
transform_qubits(
func: Callable[['cirq.Qid'], 'cirq.Qid']
) -> cirq.ops.raw_types.TSelf
Returns the same operation, but with different qubits.
Args | |
---|---|
func
|
The function to use to turn each current qubit into a desired new qubit. |
Returns | |
---|---|
The receiving operation but with qubits transformed by the given function. |
validate_args
validate_args(
qubits: Sequence[cirq.ops.Qid
]
) -> None
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
with_probability(
probability: "cirq.TParamVal"
) -> "cirq.Operation"
with_qubits
with_qubits(
*new_qubits
) -> cirq.ops.pauli_string_raw_types.TSelf_PauliStringGateOperation
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
with_tags(
*new_tags
) -> "cirq.TaggedOperation"
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__
__eq__(
other: _SupportsValueEquality
) -> bool
__ne__
__ne__(
other: _SupportsValueEquality
) -> bool
__pow__
__pow__(
exponent: Union[float, sympy.Symbol]
) -> "PauliStringPhasor"