Class PassManager

java.lang.Object
com.quantum4j.transpile.PassManager

public final class PassManager extends Object
Manages and applies a sequence of transpiler passes to a quantum circuit.

Architecture rules enforced:

  • Input circuits are deep-cloned before any pass runs.
  • Passes are executed sequentially in insertion order.
  • Pass names must be non-null/non-empty for traceability.
  • Pass outputs are fed as inputs to the next pass.
  • Constructor Details

    • PassManager

      public PassManager()
  • Method Details

    • addPass

      public PassManager addPass(TranspilerPass pass)
      Append a transpiler pass to the pipeline.
      Parameters:
      pass - pass to add
      Returns:
      this manager for chaining
    • getPasses

      public List<TranspilerPass> getPasses()
      Get the configured passes in insertion order.
      Returns:
      unmodifiable list of passes
    • run

      public QuantumCircuit run(QuantumCircuit circuit)
      Run all passes sequentially on the given circuit. The input circuit is deep-cloned before any transformation to preserve immutability guarantees.
      Parameters:
      circuit - input circuit (not mutated)
      Returns:
      transformed circuit after all passes