QPredictDecompositionPass

class QPredictDecompositionPass(block_size_start=2, block_size_limit=None, fail_limit=3, success_threshold=1e-08, progress_threshold_r=0.05, progress_threshold_a=1e-08, cost=<bqskit.ir.opt.cost.functions.residuals.hilbertschmidt.HilbertSchmidtResidualsGenerator object>, max_depth=None, instantiate_options={})[source]

Bases: SynthesisPass

The QPredictDecompositionPass class.

Breaks down the input unitary into blocks.

__init__(block_size_start=2, block_size_limit=None, fail_limit=3, success_threshold=1e-08, progress_threshold_r=0.05, progress_threshold_a=1e-08, cost=<bqskit.ir.opt.cost.functions.residuals.hilbertschmidt.HilbertSchmidtResidualsGenerator object>, max_depth=None, instantiate_options={})[source]

QPredictDecompositionPass Constructor.

Parameters:
  • block_size_start (int) – The smallest block size to append each step. (Default: 2)

  • block_size_limit (int | None) – The largest block size to append each step. If left as None, the unitary being synthesized provides the limit. (Default: None)

  • fail_limit (int) – The amount of tries to make progress before increasing block size. (Default: 2)

  • success_threshold (float) – The distance threshold that determines successful termintation. Measured in cost described by the cost function. (Default: 1e-6)

  • progress_threshold (float) – The distance necessary to improve for the synthesis algorithm to complete a layer and move on. Lowering this will led to synthesis going deeper quicker, and raising it will force to algorithm to spend more time on each layer. Caution, changing this too much might break the synthesis algorithm. (Default: 5e-3)

  • cost (CostFunction | None) – The cost function that determines distance during synthesis. The goal of this synthesis pass is to implement circuits for the given unitaries that have a cost less than the success_threshold. (Default: HSDistance())

  • max_depth (int) – The maximum number of gates to append without success before termination. If left as None it will default to unlimited. (Default: None)

  • (dict[str (instantiate_options) – Any]): Options passed directly to circuit.instantiate when instantiating circuit templates. (Default: {})

Raises:
  • ValueError – If block_size_start is nonpositive.

  • ValueError – If block_size_limit is less than block_size_start.

  • ValueError – If fail_limit is nonpositive.

  • ValueError – If max_depth is nonpositive.

Attributes

name

The name of the pass.

Methods

analyze_remainder(R, locations)

Perform remainder analysis on R to sort locations.

decode_qubits(pauli_coef_index)

Decode pauli_coef_index into qubit indices.

execute(*args, **kwargs)

Map a function over iterable arguments in parallel.

get_connectivity(_, data)

Retrieve the current connectivity of the circuit.

get_model(_, data)

Retrieve the machine model from the data dictionary.

get_placement(_, data)

Retrieve the logical to physical qubit map from the data dictionary.

get_target(_, data)

Retrieve the target from the data dictionary.

in_parallel(data)

Return true if pass is being executed in a parallel.

run(circuit, data)

Perform the pass's operation, see BasePass for more.

synthesize(utry, data)

Synthesize utry, see SynthesisPass for more.