Expand description
An umbrella crate for pg-libs, TKET’s Pauli graph libraries. It re-exports core types, transformation and synthesis passes, and supporting utilities.
§Quick start
This example optimizes the T count and synthesizes a two qubit Clifford+T circuit.
use tk_pg_libs::{GateData, GateType, Op, PauliGraph};
use tk_pg_libs::passes::{
CanonicalFormPass, GreedySynthPass, GroupCommutingOpsPass, PGPass,
RotationMergingPass, TOptimizationPass,
};
let mut pg = PauliGraph::new(2);
for data in [
GateData::new(GateType::RZ, vec![1]).with_params(vec![0.25]),
GateData::new(GateType::ZX, vec![0, 1]), // CX(0, 1)
GateData::new(GateType::ZX, vec![1, 0]), // CX(1, 0)
GateData::new(GateType::RZ, vec![0]).with_params(vec![0.25]),
] {
pg.add_op(Op::Gate { data });
}
let pg = CanonicalFormPass::new().transform(&pg);
let pg = RotationMergingPass::new().transform(&pg);
let pg = TOptimizationPass::new().transform(&pg);
let pg = GroupCommutingOpsPass::new().transform(&pg);
let pg = GreedySynthPass::new().transform(&pg);passes::TOptimizationPass uses no ancillas by default and requires rotation
angles that are multiples of 0.25 half turns.
Measurements, resets, and black boxes are not supported as input to this pass.
Modules§
- bitpacked
- This crate implements Clifford conjugation on bit-packed representations of Pauli operators. The unstable_simd feature enables the use of the nightly portable_simd API.
- core
- This crate contains the core data structures and traits for the
pg-libslibrary. - ir_
kernels - This crate implements some basic operations for PauliGraph Ops
- passes
- Canonical form, optimization, synthesis and rebasing passes for
PauliGraph. - qm_
tableau - Clifford tableaux using a qubit major memory layout.
- tk_
converter - This crate provides conversion functions between
PauliGraphand serialized TKET circuit format as well as a function to compare the unitaries of twoPauliGraphs by callingpytket. - utils
- This crate provides utility functions for working with pg-libs
Structs§
- Black
BoxData - Data associated with an opaque black-box operation.
- Conditional
BoxData - Data for a conditional box of operations.
- Gate
Data - Data associated with a gate operation.
- Measure
Data - Data associated with a Pauli measurement.
- Pauli
Graph - A tk-pg-core program consisting of a qubit count and an ordered list of operations.
- Reset
Data - Data associated with a reset operation.
- Rotation
Data - Data associated with a Pauli rotation.
- Tableau
Data - Tableau image data for a Clifford operation.
Enums§
- Gate
Type - The supported gate types that can appear in a Pauli graph.
- Op
- An operation node in a Pauli graph.
- Pauli
- A single-qubit Pauli operator.
- Pauli
Graph Error - Error type for PauliGraph operations and input validation.
Traits§
- PGPass
- A transformation pass over a Pauli graph.