ObservationFinder#

class ObservationFinder(observations, skip_unparseable=False)#

Bases: dict

Query structure for a set of observations.

This class enables reasonably efficient filtering of an observation set based on the observation name elements (e.g. find all T1 times / parameters of a particular gate/impl/locus etc. in the set).

The class has utility methods for querying specific types observations. The idea is to keep all the logic related to the structure of the observation names encapsulated in this class/module.

Currently implemented using a nested dictionary that follows the dotted structure of the observation names. The nested dictionary is not ideal for all searches/filterings, but it’s just an implementation detail that can be improved later on without affecting the public API of this class.

Parameters:
  • observations (Iterable[ObservationBase]) – Observations to include in the query structure.

  • skip_unparseable (bool) – If True, ignore any observation whose name cannot be parsed, otherwise raise an exception.

Module: iqm.station_control.client.qon

Methods

get_coherence_times

T1 and T2 coherence times for the given QPU components.

get_gate_duration

Duration for the given gate/implementation/locus (in s), or None if not found.

get_gate_fidelity

Fidelity of the given gate/implementation/locus, or None if not found.

get_measure_errors

Measurement errors of the given gate/implementation/locus, or None if not found.

_build_dict(pre_path, keys, post_path)#

Get the same property for multiple path elements, if it exists.

Follows pre_path to a base node, then for every item in keys follows [key] + post_path and gets the corresponding value.

Parameters:
  • pre_path (Iterable[str]) – Initial path in the tree to the base node.

  • keys (Iterable[str]) – Path elements under the base node to retrieve.

  • post_path (Iterable[str]) – Final path to follow for each of keys.

Returns:

Mapping from keys to the corresponding values. If a key is missing or [key] + post_path could not be followed, that particular key does not appear in the mapping.

Raises:

KeyError – Could not follow pre_path.

Return type:

dict[str, float]

_get_path_value(path)#

Follow path, return the final value.

Parameters:

path (Iterable[str]) –

Return type:

float

_get_path_node(path)#

Follow path, return the final node.

Parameters:

path (Iterable[str]) –

Return type:

dict[str, Any]

get_coherence_times(components)#

T1 and T2 coherence times for the given QPU components.

If not found, the component will not appear in the corresponding dict.

Parameters:

components (Iterable[str]) –

Return type:

tuple[dict[str, float], dict[str, float]]

get_gate_duration(gate_name, impl_name, locus)#

Duration for the given gate/implementation/locus (in s), or None if not found.

Parameters:
Return type:

float | None

get_gate_fidelity(gate_name, impl_name, locus)#

Fidelity of the given gate/implementation/locus, or None if not found.

Parameters:
Return type:

float | None

get_measure_errors(gate_name, impl_name, locus)#

Measurement errors of the given gate/implementation/locus, or None if not found.

Parameters:
Return type:

tuple[float, float] | None