cirq.google.ExpWGate

class cirq.google.ExpWGate(*, axis_half_turns: Union[cirq.value.symbol.Symbol, float, NoneType] = None, axis_rads: Union[float, NoneType] = None, axis_degs: Union[float, NoneType] = None, half_turns: Union[cirq.value.symbol.Symbol, float, NoneType] = None, rads: Union[float, NoneType] = None, degs: Union[float, NoneType] = None)[source]

A rotation around an axis in the XY plane of the Bloch sphere.

This gate is a “phased X rotation”. Specifically:
───W(axis)^t─── = ───Z^-axis───X^t───Z^axis───
This gate is exp(-i * pi * W(axis_half_turn) * half_turn / 2) where
W(theta) = cos(pi * theta) X + sin(pi * theta) Y
or in matrix form
W(theta) = [[0, cos(pi * theta) - i sin(pi * theta)],
[cos(pi * theta) + i sin(pi * theta), 0]]

Note the half_turn nomenclature here comes from viewing this as a rotation on the Bloch sphere. Two half_turns correspond to a rotation in the bloch sphere of 360 degrees. Note that this is minus identity, not just identity. Similarly the axis_half_turns refers thinking of rotating the Bloch operator, starting with the operator pointing along the X direction. An axis_half_turn of 1 corresponds to the operator pointing along the -X direction while an axis_half_turn of 0.5 correspond to an operator pointing along the Y direction.

__init__(*, axis_half_turns: Union[cirq.value.symbol.Symbol, float, NoneType] = None, axis_rads: Union[float, NoneType] = None, axis_degs: Union[float, NoneType] = None, half_turns: Union[cirq.value.symbol.Symbol, float, NoneType] = None, rads: Union[float, NoneType] = None, degs: Union[float, NoneType] = None) → None[source]

Initializes the gate.

At most one rotation angle argument may be specified. At most one axis angle argument may be specified. If more are specified, the result is considered ambiguous and an error is thrown. If no angle argument is given, the default value of one half turn is used.

The axis angle determines the rotation axis in the XY plane, with 0 being positive-ward along X and 90 degrees being positive-ward along Y.

Parameters:
  • axis_half_turns – The axis angle in the XY plane, in half_turns.
  • axis_rads – The axis angle in the XY plane, in radians.
  • axis_degs – The axis angle in the XY plane, in degrees.
  • half_turns – The amount to rotate, in half_turns.
  • rads – The amount to rotate, in radians.
  • degs – The amount to rotate, in degrees.

Methods

from_proto(op)
has_inverse()
has_matrix()
inverse()
is_parameterized() Whether the effect is parameterized.
is_xmon_op(op)
matrix()
on(*qubits) Returns an application of this gate to the given qubits.
on_each(targets) Returns a list of operations apply this gate to each of the targets.
parameterized_value_from_proto(message)
parameterized_value_to_proto(param, float], out)
phase_by(phase_turns, qubit_index) Returns a phased version of the effect.
text_diagram_info(args) Describes how to draw something in a text diagram.
to_proto(*qubits)
trace_distance_bound() A maximum on the trace distance between this effect’s input/output.
try_cast_to(desired_type, ext) Turns this value into the desired type, if possible.
try_get_xmon_gate(op)
validate_args(qubits) Checks if this gate can be applied to the given qubits.
with_parameters_resolved_by(param_resolver) Resolve the parameters in the effect.