CrosstalkMatrix
- class qililab.CrosstalkMatrix
Bases:
objectA class to represent a crosstalk matrix where each index corresponds to a bus.
Attributes Summary
Methods Summary
flux_to_bias(flux)Converts target flux values to hardware bias values using linear inversion.
from_array(buses, matrix_array)Creates crosstalk matrix from an array and corresponding set of buses.
from_buses(buses)Creates a CrosstalkMatrix with all possible associations set to 1.0.
inverse()Returns the inverse version of the crosstalk matrix (as a bus dictionary).
set_offset(offset)Modifies the offset based on the given bus and offset value
set_resistances(resistances)Modifies the resistances dictionary based on the given bus and resistance value.
to_array()Returns the np.array representation of the crosstalk matrix.
Attributes Documentation
Methods Documentation
- flux_to_bias(flux)
Converts target flux values to hardware bias values using linear inversion.
Applies the inverse of the crosstalk matrix to the flux vector, accounting for flux offsets. Both scalar and array inputs are supported — array inputs are processed element-wise, enabling sweep-based use cases.
- Parameters:
flux (
dict[str,float | np.ndarray]) – Target flux values keyed by bus name. Values can be scalars or numpy arrays of the same length.- Returns:
Hardware bias values keyed by bus name.
- Return type:
dict[str, float | np.ndarray]
- classmethod from_array(buses, matrix_array)
Creates crosstalk matrix from an array and corresponding set of buses. For a set of buses [bus1,bus2,…,busN] the corresponding matrix should have the same indices for rows and columns i.e. for the set of buses [bus1,bus2,…,busN], matrix[0,0] will be the coefficient for bus1[bus1], matrix[0,1] will be bus1[bus2], etc.
- Parameters:
buses (
list[str]) – ordered list of buses for the crosstalk matrixmatrix_array (
np.ndarray) – crosstalk matrix numpy array
- Returns:
CrosstalkMatrix: An instance of CrosstalkMatrix
- Return type:
- classmethod from_buses(buses)
Creates a CrosstalkMatrix with all possible associations set to 1.0.
- Parameters:
buses (
Sequence[str]) – A sequence of bus names.- Returns:
An instance of CrosstalkMatrix with all associations set to 1.0.
- Return type:
- inverse()
Returns the inverse version of the crosstalk matrix (as a bus dictionary).
- Returns:
inverse crosstalk matrix
- Return type:
- set_offset(offset)
Modifies the offset based on the given bus and offset value
- Parameters:
offset (
dict[str,float]) – dictionary containing the buses of the offsets to be added or modified and the value of said offsets