BasisGateLibrary#

class BasisGateLibrary(basis_gates=None, default_values=None, **extra_kwargs)[source]#

A base class for libraries of basis gates to make it easier to setup Calibrations.

Setup the library.

Parameters:
  • basis_gates (List[str] | None) – The basis gates to generate.

  • default_values (Dict | None) – A dictionary to override library default parameter values.

  • extra_kwargs – Extra key-word arguments of the subclasses that are saved to be able to reconstruct the library using the __init__() method.

Raises:

CalibrationError – If on of the given basis gates is not supported by the library.

Attributes

basis_gates#

Return the basis gates supported by the library.

Methods

__getitem__(name)[source]#

Return the schedule.

Return type:

ScheduleBlock

__len__()[source]#

The length of the library defined as the number of basis gates.

config()[source]#

Return the settings used to initialize the library.

Return type:

Dict[str, Any]

abstract default_values()[source]#

Return the default values for the parameters.

Returns

A list of tuples is returned. These tuples are structured so that instances of Calibrations can call Calibrations.add_parameter_value() on the tuples.

Return type:

List[DefaultCalValue]

classmethod from_config(config)[source]#

Deserialize the library given the input dictionary

Return type:

BasisGateLibrary

get(k[, d]) D[k] if k in D, else d.  d defaults to None.#
items() a set-like object providing a view on D's items#
keys() a set-like object providing a view on D's keys#
num_qubits(name)[source]#

Return the number of qubits that the schedule with the given name acts on.

Return type:

int

values() an object providing a view on D's values#