Skip to main content
Every data loading method accepts a synthesis_options argument that selects the compilation method and its parameters. Pass one of the classes below, or an equivalent dict whose "method" key names one of them.

class haiqu.sdk.AnalyticalSynthesisOptions(*, fine_tuning_iterations=0, method=‘analytical’, num_layers=2, layer_type=‘V’, bond_dim_layer=2, entanglement_cutoff=1e-06)

Synthesis options for the analytical compilation method. Builds a full disentangling layer at once in closed form, with gates as wide as the bond dimension requires. The cheapest of the three methods and the best fit for smooth, weakly entangled targets.
  • Parameters:
    • num_layers (int) — Number of disentangling layers. More layers raise the fidelity at the cost of a deeper circuit. Defaults to 2.
    • layer_type (Literal [ ‘linear’ , ‘reverse_linear’ , ‘V’ ]) — Geometry of the disentangler staircase, one of "V", "linear" and "reverse_linear". Defaults to "V".
    • bond_dim_layer (int | None) — Bond dimension each layer is truncated to, which sets the width of that layer’s gates. None sets it to the embedding’s feature density, and to 2 for a density below that, so that a layer is always wide enough to absorb one feature. It applies to the density in use, whether it was requested directly or derived from num_qubits, and only entangled_manifold_embedding() accepts it. Defaults to 2.
    • entanglement_cutoff (float) — Bonds carrying less entanglement than this threshold are left without a gate. Applied from the second layer onward. Defaults to 1e-6.
    • fine_tuning_iterations (int)
    • method (Literal [ ‘analytical’ ])

Example

class haiqu.sdk.BlockwiseSynthesisOptions(*, fine_tuning_iterations=0, method=‘blockwise’, num_layers=2, layer_type=‘V’, bond_dim_layer=2)

Synthesis options for the blockwise compilation method. Builds each layer block by block. Uses optimal analytical synthesis for 2-qubit gates, optimal numerical synthesis for 3-qubit gates and variational synthesis for larger gates. Costs more classical time than the analytical method but tends to spend fewer CX gates for the same fidelity.
  • Parameters:
    • num_layers (int) — Number of disentangling layers. More layers raise the fidelity at the cost of a deeper circuit. Defaults to 2.
    • layer_type (Literal [ ‘linear’ , ‘reverse_linear’ , ‘V’ ]) — Geometry of the disentangler staircase, one of "V", "linear" and "reverse_linear". Defaults to "V".
    • bond_dim_layer (int | None) — Bond dimension each layer is truncated to, which sets the width of that layer’s gates. None sets it to the embedding’s feature density, and to 2 for a density below that, so that a layer is always wide enough to absorb one feature. It applies to the density in use, whether it was requested directly or derived from num_qubits, and only entangled_manifold_embedding() accepts it. Defaults to 2.
    • fine_tuning_iterations (int)
    • method (Literal [ ‘blockwise’ ])

Example

class haiqu.sdk.VariationalSynthesisOptions(*, fine_tuning_iterations=0, method=‘variational’, num_layers=2, layer_type=‘brickwork’, gate_cnots=2, force_complex=False, entanglement_cutoff=1e-06)

Synthesis options for the variational compilation method. Performs variational synthesis of the quantum circuit which approximately matches the desired quantum state. Supports usage of a brickwork layer, which produces the shallowest circuits.
  • Parameters:
    • num_layers (int) — Number of disentangling layers. More layers raise the fidelity at the cost of a deeper circuit. Defaults to 2.
    • layer_type (Literal [ ‘linear’ , ‘reverse_linear’ , ‘V’ , ‘brickwork’ ]) — Geometry of the gate layers, one of "brickwork", "V", "linear" and "reverse_linear". Defaults to "brickwork".
    • gate_cnots (Literal *[*1 , 2 , 3 ]) — Number of CX gates in each two-qubit gate. More CX gates make a gate able to represent more entanglement. One of 1, 2 or 3. Defaults to 2.
    • force_complex (bool) — Use complex rotations even when the target state is real. A real target is preparable with real rotations alone, which halves the parameter count if not forced. Defaults to False.
    • entanglement_cutoff (float) — Bonds carrying less entanglement than this threshold are left without a gate. Defaults to 1e-6.
    • fine_tuning_iterations (int)
    • method (Literal [ ‘variational’ ])

Example

class haiqu.sdk.DataLoadingSynthesisOptions(*, fine_tuning_iterations=0)

Circuit synthesis parameters shared by every compilation method. Do not instantiate directly; use AnalyticalSynthesisOptions, BlockwiseSynthesisOptions or VariationalSynthesisOptions. Each method accepts a different set of parameters, so passing one method’s parameter to another is rejected rather than silently ignored.
  • Parameters: fine_tuning_iterations (int) — Maximum refinement iterations that are run after the circuit is built to improve the produced state. 0 skips the refinement. Defaults to 0.