QuestRunner

class QuestRunner(sub_runner, block_size=3, compiler=None, weit=0.5, pert=100, approx_threshold=None, sample_size=16, model=None, instantiate_options={})[source]

Bases: CircuitRunner

Simulate a circuit using the Quest algorithm.

References

Patel, Tirthak, et al. “Robust and Resource-Efficient Quantum Circuit Approximation.” arXiv preprint arXiv:2108.12714 (2021).

__init__(sub_runner, block_size=3, compiler=None, weit=0.5, pert=100, approx_threshold=None, sample_size=16, model=None, instantiate_options={})[source]

Run the QUEST algorithm using sub_runner to execute circuits.

Parameters:
  • sub_runner (CircuitRunner) – The CircuitRunner to execute the approximated circuits.

  • block_size (int) – The maximum number of qudits in each block. Defaults to 3.

  • compiler (Compiler | None) – The compiler object used to partitioning and synthesize the circuit. If left as None, then a standard compiler will be created.

  • weit (float) – The weight set on number of CNOTs versus approximation dissimilarity. Default 0.5.

  • pert (int) – The percentile of sample distances used to judge approximation quality.

  • approx_threshold (float | None) – The maximum allowed error in the approximation. If left as None, then it will be computed based on the number of blocks.

  • sample_size (int) – The number of approximations to generate.

  • model (MachineModel | None) – The model to compile to.

  • instantiate_options (dict[str, Any]) – Options passed directly to instantiation.

Methods

approximate_circuit(circuit, psols, pts)

Use partial block solutions to compute circuit approximations.

assemble_circuit(circuit, blocks, psols, pts)

Assemble a circuit from a list of block indices.

parse_data(blocked_circuit, data)

Parse the data outputed from synthesis.

run(circuit)

Execute the circuit, see CircuitRunner.run for more info.