iqm.benchmarks.compressive_gst.compressive_gst.GSTConfiguration#

class iqm.benchmarks.compressive_gst.compressive_gst.GSTConfiguration(*, benchmark: ~typing.Type[~iqm.benchmarks.benchmark_definition.Benchmark] = <class 'iqm.benchmarks.compressive_gst.compressive_gst.CompressiveGST'>, shots: int = 1024, max_gates_per_batch: int | None = None, calset_id: str | None = None, routing_method: ~typing.Literal['basic', 'lookahead', 'stochastic', 'sabre', 'none'] = 'sabre', physical_layout: ~typing.Literal['fixed', 'batching'] = 'fixed', qubit_layouts: ~typing.List[int] | ~typing.List[~typing.List[int]], gate_set: str | ~typing.List[~typing.Any], num_circuits: int, rank: int, gate_labels: ~typing.List | None = None, seq_len_list: list[int] = [1, 8, 14], from_init: bool = True, max_inits: int = 20, opt_method: str = 'auto', max_iterations: str | ~typing.List[int] = 'auto', convergence_criteria: str | ~typing.List[float] = [4, 0.0001], batch_size: str | int = 'auto', bootstrap_samples: int = 0, testing: bool = False)#

Bases: BenchmarkConfigurationBase

Compressive GST configuration base.

Parameters:
  • benchmark (Type[Benchmark]) –

  • shots (int) –

  • max_gates_per_batch (int | None) –

  • calset_id (str | None) –

  • routing_method (Literal['basic', 'lookahead', 'stochastic', 'sabre', 'none']) –

  • physical_layout (Literal['fixed', 'batching']) –

  • qubit_layouts (List[int] | List[List[int]]) –

  • gate_set (str | List[Any]) –

  • num_circuits (int) –

  • rank (int) –

  • gate_labels (List | None) –

  • seq_len_list (list[int]) –

  • from_init (bool) –

  • max_inits (int) –

  • opt_method (str) –

  • max_iterations (str | List[int]) –

  • convergence_criteria (str | List[float]) –

  • batch_size (str | int) –

  • bootstrap_samples (int) –

  • testing (bool) –

benchmark#

GHZBenchmark

Type:

Type[Benchmark]

qubit_layouts#

A sequence (e.g., Tuple or List) of sequences of physical qubit layouts, as specified by integer labels, where the benchmark is meant to be run.

Type:

Sequence[Sequence[int]]

gate_set#

The gate set in given either as a list of qiskit quantum cirucuits, or as one of the predefined gate sets “1QXYI”, “2QXYCZ”, “2QXYCZ_extended”, “3QXYCZ”. A gate set should be tomographically complete, meaning from the specified gates and the vacuum state, one should be able to prepare states that form a frame for the state space. A practical sufficient condition is that the gate set is able the generate all combinations of local Pauli eigenstates.

Type:

Union[str, List[Type[QuantumCircuit]]]

num_circuits#

How many random circuits are generated from the gate set. Guidelines on choosing this value: - At least 50 circuits for a single qubit gate set with 3 gates. - At least 400 circuits for a two qubit gate set with 6 gates. - At least 2000 circuits for a three qubit gate set with 9 gates. The number of random circuits needed is expected to grow linearly in the number of gates and exponentially in the number of qubits.

Type:

int

rank#

The Kraus rank of the reconstruction. Choose rank=1 for coherent error analysis and rank<=dim**2 generally.

Type:

int

shots#

The number of measurement shots per circuit. * Default: 1024

Type:

int

gate_labels#

Names of the gates in the gate set. Used for plots and result tables. * Default: None

Type:

Union[Dict, None]

seq_len_list#

Three numbers controling the depth of the random sequences. The first is the minimal depth, the last is the maximal depth and the middle number specifies a cutoff depth below which all possible sequences are selected. * Default: [1, 8, 14]

Type:

list[int]

from_init#

Whether the target gate set is used as an initialization to the mGST algorithm. * Default: True

Type:

bool

max_inits#

If from_init = False, random initial points are tried and this parameter limits the amount of retries. * Default: 20

Type:

int

opt_method#

Which optimization method is used, can be either of “GD” or “SFN”, for gradient descent or saddle free Newton, respectively. * Default: “auto” (Method is automatically selected based on qubit count and rank)

Type:

str

max_iterations#

How many iterations to run the optimization algorithm for. Accepted values are either “auto” or a list of two integers. The first specifies the number of iterations for the optimization on batches or circuit data, while the second specifies the number of iterations on the full data for all circuits. * Default: “auto” (Numbers are automatically selected based on qubit count and rank)

Type:

Union[str, List[int]]

convergence_criteria#

Two parameters which determine when the optimization algorithm terminates. The first is a multiplier which specifies how close the cost function should get to a threshold for the given shot noise in order for the optimization to be considered “successful”. Values in [2,10] are usually sensible. The second parameter sets the relative change in cost function between two consecutive iterations, below which the algorithm terminates. * Default: [4, 1e-4]

Type:

Union[str, List[float]]

batch_size#

The number of circuits per batch in the optimization. This hyperparamters is automatically set and determines the convergence behaviour. A smaller batch size reduces runtime but can lead to erratic jumps in parameter space and lack of convergence. * Default: “auto”

Type:

Union[str, int]

bootstrap_samples#

The number of times the optimization algorithm is repeated on fake data to estimate the uncertainty via bootstrapping.

Type:

int

Attributes

model_computed_fields

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

benchmark

qubit_layouts

gate_set

num_circuits

rank

shots

gate_labels

seq_len_list

from_init

max_inits

opt_method

max_iterations

convergence_criteria

batch_size

bootstrap_samples

testing

max_gates_per_batch

calset_id

routing_method

physical_layout

Methods

model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[Dict[str, FieldInfo]] = {'batch_size': FieldInfo(annotation=Union[str, int], required=False, default='auto'), 'benchmark': FieldInfo(annotation=Type[Benchmark], required=False, default=<class 'iqm.benchmarks.compressive_gst.compressive_gst.CompressiveGST'>), 'bootstrap_samples': FieldInfo(annotation=int, required=False, default=0), 'calset_id': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'convergence_criteria': FieldInfo(annotation=Union[str, List[float]], required=False, default=[4, 0.0001]), 'from_init': FieldInfo(annotation=bool, required=False, default=True), 'gate_labels': FieldInfo(annotation=Union[List, NoneType], required=False, default=None), 'gate_set': FieldInfo(annotation=Union[str, List[Any]], required=True), 'max_gates_per_batch': FieldInfo(annotation=Union[int, NoneType], required=False, default=None), 'max_inits': FieldInfo(annotation=int, required=False, default=20), 'max_iterations': FieldInfo(annotation=Union[str, List[int]], required=False, default='auto'), 'num_circuits': FieldInfo(annotation=int, required=True), 'opt_method': FieldInfo(annotation=str, required=False, default='auto'), 'physical_layout': FieldInfo(annotation=Literal['fixed', 'batching'], required=False, default='fixed'), 'qubit_layouts': FieldInfo(annotation=Union[List[int], List[List[int]]], required=True), 'rank': FieldInfo(annotation=int, required=True), 'routing_method': FieldInfo(annotation=Literal['basic', 'lookahead', 'stochastic', 'sabre', 'none'], required=False, default='sabre'), 'seq_len_list': FieldInfo(annotation=list[int], required=False, default=[1, 8, 14]), 'shots': FieldInfo(annotation=int, required=False, default=1024), 'testing': FieldInfo(annotation=bool, required=False, default=False)}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.