Package com.quantum4j.transpile.passes
Class GateCommutationPass
java.lang.Object
com.quantum4j.transpile.passes.GateCommutationPass
- All Implemented Interfaces:
TranspilerPass
Local commutation optimizer. Safely bubbles commuting gates earlier in the circuit without crossing non-commuting
operations or measurements. Conservative rules:
- Single-qubit gates on different qubits commute.
- RZ on control commutes with CX(control,target).
- RX on target commutes with CX(control,target).
- Never move across measurements.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply(QuantumCircuit circuit) Apply this pass to the given circuit and return a new circuit.name()Human-readable name of this pass (for logging, debugging, profiling).
-
Constructor Details
-
GateCommutationPass
public GateCommutationPass()Create the gate commutation pass.
-
-
Method Details
-
name
Description copied from interface:TranspilerPassHuman-readable name of this pass (for logging, debugging, profiling).- Specified by:
namein interfaceTranspilerPass- Returns:
- pass identifier
-
apply
Description copied from interface:TranspilerPassApply this pass to the given circuit and return a new circuit. Implementations should not mutate the input circuit.- Specified by:
applyin interfaceTranspilerPass- Parameters:
circuit- input circuit (not mutated)- Returns:
- transformed circuit
-