Package com.quantum4j.core.gates
Class CZGate
java.lang.Object
com.quantum4j.core.gates.TwoQubitGate
com.quantum4j.core.gates.CZGate
- All Implemented Interfaces:
Gate
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 ]
-
Field Summary
Fields inherited from class com.quantum4j.core.gates.TwoQubitGate
matrix -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.quantum4j.core.gates.TwoQubitGate
apply, arity
-
Constructor Details
-
CZGate
public CZGate()
-
-
Method Details
-
name
Description copied from interface:GateGet the name of this gate (e.g., "H", "X", "CNOT").- Returns:
- the gate name
-