Class CZGate

All Implemented Interfaces:
Gate

public final class CZGate extends TwoQubitGate
Controlled-Z (CZ) quantum gate.

A two-qubit gate that applies a phase flip (Z gate) to the target qubit if the control qubit is |1⟩. Equivalently, it applies a -1 phase if both qubits are |1⟩. The gate matrix is diagonal:

 [1  0  0   0 ]
 [0  1  0   0 ]
 [0  0  1   0 ]
 [0  0  0  -1 ]
 
  • Constructor Details

    • CZGate

      public CZGate()
  • Method Details

    • name

      public String name()
      Description copied from interface: Gate
      Get the name of this gate (e.g., "H", "X", "CNOT").
      Returns:
      the gate name