rydiqule.sensor_utils.nx_edges_with

rydiqule.sensor_utils.nx_edges_with(couplings_graph: Graph, *keys: str, method: Literal['all', 'any', 'not any', 'not all'] = 'all') Dict[Tuple[int | str | Tuple[float, ...], int | str | Tuple[float, ...]], Dict][source]

Returns a version of couplings_graph with only the keys specified.

Can be specified with a several criteria, including all, none, or any of the keys specified.

Parameters:
  • keys (tuple of str) – tuple of strings which should be one the valid parameter names for a state. See add_coupling() for which names are valid for a Sensor object.

  • method (Literal['all','any', 'not any', 'not all'], optional) – Method to see if a given field matches the keys given. Choosing “all” will return couplings which have keys matching all of the values provided in the keys argument, while choosing “any”, will return all couplings with keys matching at least one of the values specified by keys. For example, sensor.couplings_with("rabi_frequency") returns a dictionary of all couplings for which a rabi_frequency was specified. sensor.couplings_with("rabi_frequency", "detuning", method="all") returns all couplings for which both rabi_frequency and detuning are specified. ‘sensor.couplings_with(“rabi_frequency”, “detuning”, method=”any”)` returns all couplings for which either rabi_frequency or detuning are specified. “not any” and “not all” give the inverse of the above. Defaults to “all”.

Returns:

A copy of the couplings_graph edges dictionary with only couplings containing the specified parameter keys.

Return type:

dict