cirq.CNotGate

class cirq.CNotGate(*, half_turns: Union[cirq.value.symbol.Symbol, float, NoneType] = None, rads: Union[float, NoneType] = None, degs: Union[float, NoneType] = None)[source]

A controlled-NOT. Toggle the second qubit when the first qubit is on.

__init__(*, 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 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.

Parameters:
  • half_turns – Relative phasing of CNOT’s eigenstates, in half_turns.
  • rads – Relative phasing of CNOT’s eigenstates, in radians.
  • degs – Relative phasing of CNOT’s eigenstates, in degrees.

Methods

default_decompose(qubits) Yields operations for performing this gate on the given qubits.
extrapolate_effect(factor)
inverse()
is_parameterized() Whether the effect is parameterized.
known_qasm_output(qubits, …], args) Returns lines of QASM output representing the gate on the given qubits or None if a simple conversion is not possible.
matrix()
on(*qubits) Returns an application of this gate to the given qubits.
text_diagram_info(args) Describes how to draw something in a text diagram.
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.
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.

Attributes

half_turns