qibocal package#

qibocal: Quantum Calibration Verification and Validation using Qibo.

class qibocal.Executor(history: History, output: Path, targets: Union[list[Union[str, int]], list[Tuple[Union[str, int], Union[str, int]]], list[tuple[Union[str, int], ...]]], platform: Platform, update: bool = True)[source]#

Bases: object

Execute a tasks’ graph and tracks its history.

history: History#

The execution history, with results and exit states.

output: Path#

Output path.

targets: Union[list[Union[str, int]], list[Tuple[Union[str, int], Union[str, int]]], list[tuple[Union[str, int], ...]]]#

Qubits/Qubit Pairs to be calibrated.

platform: Platform#

Qubits’ platform.

update: bool = True#

Runcard update mechanism.

classmethod create(platform: Optional[Union[Platform, str]] = None, output: Optional[Union[str, bytes, PathLike]] = None)[source]#

Load list of protocols.

run_protocol(protocol: ~qibocal.auto.operation.Routine, parameters: ~typing.Union[dict, ~qibocal.auto.runcard.Action], mode: ~qibocal.auto.mode.ExecutionMode = ExecutionMode.None) Completed[source]#

Run single protocol in ExecutionMode mode.

Subpackages#

Submodules#

qibocal.config module#

Custom logger implemenation.

qibocal.config.raise_error(exception, message=None, args=None)[source]#

Raise exception with logging error.

Parameters:
  • exception (Exception) – python exception.

  • message (str) – the error message.

class qibocal.config.CustomHandler[source]#

Bases: StreamHandler

Custom handler for logging algorithm.

format(record)[source]#

Format the record with specific format.

_at_fork_reinit()#
acquire()#

Acquire the I/O thread lock.

addFilter(filter)#

Add the specified filter to this handler.

close()#

Tidy up any resources used by the handler.

This version removes the handler from an internal map of handlers, _handlers, which is used for handler lookup by name. Subclasses should ensure that this gets called from overridden close() methods.

createLock()#

Acquire a thread lock for serializing access to the underlying I/O.

emit(record)#

Emit a record.

If a formatter is specified, it is used to format the record. The record is then written to the stream with a trailing newline. If exception information is present, it is formatted using traceback.print_exception and appended to the stream. If the stream has an ‘encoding’ attribute, it is used to determine how to do the output to the stream.

filter(record)#

Determine if a record is loggable by consulting all the filters.

The default is to allow the record to be logged; any filter can veto this and the record is then dropped. Returns a zero value if a record is to be dropped, else non-zero.

Changed in version 3.2: Allow filters to be just callables.

flush()#

Flushes the stream.

get_name()#
handle(record)#

Conditionally emit the specified logging record.

Emission depends on filters which may have been added to the handler. Wrap the actual emission of the record with acquisition/release of the I/O thread lock. Returns whether the filter passed the record for emission.

handleError(record)#

Handle errors which occur during an emit() call.

This method should be called from handlers when an exception is encountered during an emit() call. If raiseExceptions is false, exceptions get silently ignored. This is what is mostly wanted for a logging system - most users will not care about errors in the logging system, they are more interested in application errors. You could, however, replace this with a custom handler if you wish. The record which was being processed is passed in to this method.

property name#
release()#

Release the I/O thread lock.

removeFilter(filter)#

Remove the specified filter from this handler.

setFormatter(fmt)#

Set the formatter for this handler.

setLevel(level)#

Set the logging level of this handler. level must be an int or a str.

setStream(stream)#

Sets the StreamHandler’s stream to the specified value, if it is different.

Returns the old stream, if the stream was changed, or None if it wasn’t.

set_name(name)#
terminator = '\n'#

qibocal.update module#

Helper functions to update parameters in platform.

qibocal.update.readout_frequency(freq: float, platform: Platform, qubit: Union[str, int])[source]#

Update readout frequency value in platform for specific qubit.

qibocal.update.bare_resonator_frequency(freq: float, platform: Platform, qubit: Union[str, int])[source]#

Update rbare frequency value in platform for specific qubit.

qibocal.update.readout_amplitude(amp: float, platform: Platform, qubit: Union[str, int])[source]#

Update readout amplitude value in platform for specific qubit.

qibocal.update.readout_attenuation(att: int, platform: Platform, qubit: Union[str, int])[source]#

Update readout attenuation value in platform for specific qubit.

qibocal.update.drive_frequency(freq: Union[float, tuple], platform: Platform, qubit: Union[str, int])[source]#

Update drive frequency value in platform for specific qubit.

qibocal.update.drive_amplitude(amp: Union[float, tuple], platform: Platform, qubit: Union[str, int])[source]#

Update drive frequency value in platform for specific qubit.

qibocal.update.drive_duration(duration: Union[int, tuple], platform: Platform, qubit: Union[str, int])[source]#

Update drive duration value in platform for specific qubit.

qibocal.update.crosstalk_matrix(matrix_element: float, platform: Platform, qubit: Union[str, int], flux_qubit: Union[str, int])[source]#

Update crosstalk_matrix element.

qibocal.update.iq_angle(angle: float, platform: Platform, qubit: Union[str, int])[source]#

Update iq angle value in platform for specific qubit.

qibocal.update.threshold(threshold: float, platform: Platform, qubit: Union[str, int])[source]#
qibocal.update.mean_gnd_states(gnd_state: list, platform: Platform, qubit: Union[str, int])[source]#

Update mean ground state value in platform for specific qubit.

qibocal.update.mean_exc_states(exc_state: list, platform: Platform, qubit: Union[str, int])[source]#

Update mean excited state value in platform for specific qubit.

qibocal.update.readout_fidelity(fidelity: float, platform: Platform, qubit: Union[str, int])[source]#

Update fidelity of single shot classification.

qibocal.update.assignment_fidelity(fidelity: float, platform: Platform, qubit: Union[str, int])[source]#

Update fidelity of single shot classification.

qibocal.update.virtual_phases(phases: dict[Union[str, int], float], platform: Platform, pair: Tuple[Union[str, int], Union[str, int]])[source]#

Update virtual phases for given qubits in pair in results.

qibocal.update.CZ_duration(duration: int, platform: Platform, pair: Tuple[Union[str, int], Union[str, int]])[source]#

Update CZ duration for specific pair.

qibocal.update.CZ_amplitude(amp: float, platform: Platform, pair: Tuple[Union[str, int], Union[str, int]])[source]#

Update CZ amplitude for specific pair.

qibocal.update.t1(t1: int, platform: Platform, qubit: Union[str, int])[source]#

Update t1 value in platform for specific qubit.

qibocal.update.t2(t2: int, platform: Platform, qubit: Union[str, int])[source]#

Update t2 value in platform for specific qubit.

qibocal.update.t2_spin_echo(t2_spin_echo: float, platform: Platform, qubit: Union[str, int])[source]#

Update t2 echo value in platform for specific qubit.

qibocal.update.drag_pulse_beta(beta: float, platform: Platform, qubit: Union[str, int])[source]#

Update beta parameter value in platform for specific qubit.

qibocal.update.sweetspot(sweetspot: float, platform: Platform, qubit: Union[str, int])[source]#

Update sweetspot parameter in platform for specific qubit.

qibocal.update.frequency_12_transition(frequency: int, platform: Platform, qubit: Union[str, int])[source]#
qibocal.update.drive_12_amplitude(amplitude: float, platform: Platform, qubit: Union[str, int])[source]#
qibocal.update.drive_12_duration(duration: Union[int, tuple], platform: Platform, qubit: Union[str, int])[source]#

Update drive duration value in platform for specific qubit.

qibocal.update.twpa_frequency(frequency: int, platform: Platform, qubit: Union[str, int])[source]#
qibocal.update.twpa_power(power: float, platform: Platform, qubit: Union[str, int])[source]#
qibocal.update.anharmonicity(anharmonicity: float, platform: Platform, qubit: Union[str, int])[source]#
qibocal.update.asymmetry(asymmetry: float, platform: Platform, qubit: Union[str, int])[source]#
qibocal.update.coupling(g: float, platform: Platform, qubit: Union[str, int])[source]#
qibocal.update.kernel(kernel: ndarray, platform: Platform, qubit: Union[str, int])[source]#