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
T1 and T2 coherence times for the given QPU components.
Duration for the given gate/implementation/locus (in s), or None if not found.
Fidelity of the given gate/implementation/locus, or None if not found.
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 inkeys
follows[key] + post_path
and gets the corresponding value.- Parameters:
- 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:
- _get_path_value(path)#
Follow
path
, return the final value.
- _get_path_node(path)#
Follow
path
, return the final node.
- 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.
- get_gate_duration(gate_name, impl_name, locus)#
Duration for the given gate/implementation/locus (in s), or None if not found.
- get_gate_fidelity(gate_name, impl_name, locus)#
Fidelity of the given gate/implementation/locus, or None if not found.