bath_fitter.BathFitter
- class bath_fitter.BathFitter(number_boson_modes: int, spins_per_bosonic_mode: int = 1, broadening_constraint: List[float] | None = None, background_broadening_ratio: float = 0.0, minimum_eigenfrequencies: float | None = None, maximum_eigenfrequencies: float | None = None, fitting_window: Tuple[float, float, int] | None = None, coupling_types: Dict[Tuple[int, int], List[str]] | List[str] | None = None, coupling_indices: List[Tuple[int, int]] | None = None, max_fitting_iterations: int = 5, max_fitting_error: float = 0.05)
Utility for fitting effective open quantum systems to original open quantum systems.
Initialized Fitting utility.
- Parameters:
number_boson_modes (int) – Number of bosonic modes used for the fit of bosonic baths.
spins_per_bosonic_mode (int) – Number of spin modes used to represent one bosonic mode.
broadening_constraint (Optional[List[float]]) – The optional broadening constraints. When None broadenings of bosonic modes are fitted freely. When given the relative broadening of all modes is fixed and only a prefactor is fitted. The prefactor corresponds to the Trotter timestep in a quantum circuit.
background_broadening_ratio (float) – Adds a constant background offset to the diagonal spectral functions when fitting. Given in terms of (as a ratio of) the average broadening.
minimum_eigenfrequencies (Optional[float]) – Minimal value allowed for bath eigenfrequencies.
maximum_eigenfrequencies (Optional[float]) – Maximum value allowed for bath eigenfrequencies.
fitting_window (Optional[Tuple[float,float, int]]) – The frequency window used for the fitting (start, end , steps). If no values are provided the functions uses the whole frequency range to determine the fit.
coupling_types (Optional[Union[Dict[Tuple[int, int], List[str]], List[str]]]) – A list of the couplings to include. If None, all the couplings are used: X, Y, Z.
coupling_indices (Optional[List[Tuple[int, int]]]) – A list of allowed fermionic hopping operators of the form c^dagger_j c_k that are allowed to couple to bosonic modes. For example [(0,0), (0,1)] only allows coupling operators c^dagger_0 c_0 and c^dagger_0 c_1 If None, all the couplings are allowed. The default is None.
max_fitting_iterations (int) – The maximum number of iterations a fit is tried before reporting an error not being able to fit the spectrum.
max_fitting_error (float) – The maximum allowed error in the fit of the spectrum.
- __init__(number_boson_modes: int, spins_per_bosonic_mode: int = 1, broadening_constraint: List[float] | None = None, background_broadening_ratio: float = 0.0, minimum_eigenfrequencies: float | None = None, maximum_eigenfrequencies: float | None = None, fitting_window: Tuple[float, float, int] | None = None, coupling_types: Dict[Tuple[int, int], List[str]] | List[str] | None = None, coupling_indices: List[Tuple[int, int]] | None = None, max_fitting_iterations: int = 5, max_fitting_error: float = 0.05) None
Initialized Fitting utility.
- Parameters:
number_boson_modes (int) – Number of bosonic modes used for the fit of bosonic baths.
spins_per_bosonic_mode (int) – Number of spin modes used to represent one bosonic mode.
broadening_constraint (Optional[List[float]]) – The optional broadening constraints. When None broadenings of bosonic modes are fitted freely. When given the relative broadening of all modes is fixed and only a prefactor is fitted. The prefactor corresponds to the Trotter timestep in a quantum circuit.
background_broadening_ratio (float) – Adds a constant background offset to the diagonal spectral functions when fitting. Given in terms of (as a ratio of) the average broadening.
minimum_eigenfrequencies (Optional[float]) – Minimal value allowed for bath eigenfrequencies.
maximum_eigenfrequencies (Optional[float]) – Maximum value allowed for bath eigenfrequencies.
fitting_window (Optional[Tuple[float,float, int]]) – The frequency window used for the fitting (start, end , steps). If no values are provided the functions uses the whole frequency range to determine the fit.
coupling_types (Optional[Union[Dict[Tuple[int, int], List[str]], List[str]]]) – A list of the couplings to include. If None, all the couplings are used: X, Y, Z.
coupling_indices (Optional[List[Tuple[int, int]]]) – A list of allowed fermionic hopping operators of the form c^dagger_j c_k that are allowed to couple to bosonic modes. For example [(0,0), (0,1)] only allows coupling operators c^dagger_0 c_0 and c^dagger_0 c_1 If None, all the couplings are allowed. The default is None.
max_fitting_iterations (int) – The maximum number of iterations a fit is tried before reporting an error not being able to fit the spectrum.
max_fitting_error (float) – The maximum allowed error in the fit of the spectrum.
Methods
__init__(number_boson_modes[, ...])Initialized Fitting utility.
execution_time_helper(device, algorithm, ...)Helper function to calculate the execution time for a function.
Fits a model Spin-Boson system to an original Spin-Boson system.
Fits a model Spin-Boson system to an original Spin-Fermion system.
Fits a model Spin-Boson system to a Spin spectral function.
Fits a model Fermion-Boson system to an original Fermion-Boson system.
Fits a model Fermion-Boson system to a Fermion spectral function.
Fits a model Fermion-Spin system to an original Fermion-Boson system.
fit_spin_bath_to_boson_bath(original_system, ...)Fits a model Spin-Spin system to an original Spin-Boson system.
fit_spin_bath_to_fermion_bath(...[, ...])Fits a model Spin-Spin system to an original Spin-Fermion system.
fit_spin_bath_to_spectral_function(...[, ...])Fits a model Spin-Spin system to a Spin spectral function.
from_json(json_dict)Initializes the object from a JSON representation.
spin_bath_trotterstep_from_boson_bath(...[, ...])Creates Spin-Spin Hamiltonian and Trotterstep from Spin-Boson system.
to_json()Returns a JSON representation of the object.
Attributes
The broadenings from the last fit of the spectrum.
The maximum allowed fitting error in fitting the spectrum.
The number of retries allowed when fitting the spectrum.
- __init__(number_boson_modes: int, spins_per_bosonic_mode: int = 1, broadening_constraint: List[float] | None = None, background_broadening_ratio: float = 0.0, minimum_eigenfrequencies: float | None = None, maximum_eigenfrequencies: float | None = None, fitting_window: Tuple[float, float, int] | None = None, coupling_types: Dict[Tuple[int, int], List[str]] | List[str] | None = None, coupling_indices: List[Tuple[int, int]] | None = None, max_fitting_iterations: int = 5, max_fitting_error: float = 0.05) None
Initialized Fitting utility.
- Parameters:
number_boson_modes (int) – Number of bosonic modes used for the fit of bosonic baths.
spins_per_bosonic_mode (int) – Number of spin modes used to represent one bosonic mode.
broadening_constraint (Optional[List[float]]) – The optional broadening constraints. When None broadenings of bosonic modes are fitted freely. When given the relative broadening of all modes is fixed and only a prefactor is fitted. The prefactor corresponds to the Trotter timestep in a quantum circuit.
background_broadening_ratio (float) – Adds a constant background offset to the diagonal spectral functions when fitting. Given in terms of (as a ratio of) the average broadening.
minimum_eigenfrequencies (Optional[float]) – Minimal value allowed for bath eigenfrequencies.
maximum_eigenfrequencies (Optional[float]) – Maximum value allowed for bath eigenfrequencies.
fitting_window (Optional[Tuple[float,float, int]]) – The frequency window used for the fitting (start, end , steps). If no values are provided the functions uses the whole frequency range to determine the fit.
coupling_types (Optional[Union[Dict[Tuple[int, int], List[str]], List[str]]]) – A list of the couplings to include. If None, all the couplings are used: X, Y, Z.
coupling_indices (Optional[List[Tuple[int, int]]]) – A list of allowed fermionic hopping operators of the form c^dagger_j c_k that are allowed to couple to bosonic modes. For example [(0,0), (0,1)] only allows coupling operators c^dagger_0 c_0 and c^dagger_0 c_1 If None, all the couplings are allowed. The default is None.
max_fitting_iterations (int) – The maximum number of iterations a fit is tried before reporting an error not being able to fit the spectrum.
max_fitting_error (float) – The maximum allowed error in the fit of the spectrum.
- property max_fitting_iterations: int
The number of retries allowed when fitting the spectrum.
The bath fitter uses a simple metric for the quality of the fit: Let A be the sum of squares of the difference between the fitter and target, and B be the sum of squares of the fitted spectral function. The quality of the fit is defined as the ratio A/B where a small ratio corresponds to a good fit. By default, a deviation of 5% is allowed. This value can be changed using the max_fitting_error setter. If the criterion is not met, the fitting is retried and if the number of retries exceeds the maximum, the fit fails.
- Returns:
The number of retries allowed when fitting the spectrum.
- Return type:
(int)
- property last_fitted_broadenings: List[float] | None
The broadenings from the last fit of the spectrum.
- Returns:
The broadenings if a fit has been performed.
- Return type:
Optional[List[float]]
- _set_cached_broadenings(params: Parameters) None
Set the cached broadenings to the values of the parameters.
- Parameters:
params – the parameters to extract the broadenings from
- property max_fitting_error: float
The maximum allowed fitting error in fitting the spectrum.
The bath fitter uses a simple metric for the quality of the fit: Let A be the sum of squares of the difference between the fitter and target and B be the sum of squares of the fitted spectral function. The quality of the fit is defined as the ratio A/B where a small ratio corresponds to a good fit. By default, a deviation of 5% is allowed. If the criterion is not met, the fitting is retried and if the number of retries exceeds the maximum the fit fails. By default, the number of retries is 5. This value can be changed using the max_fitting_iterations setter.
- Returns:
The maximum allowed fitting error as a ratio between spectrum deviation and the spectrum.
- Return type:
(float)
- _get_coupling_types(number_particles: int, is_spin: bool) Dict[Tuple[int, int], List[str]]
- to_json() Dict[str, Any]
Returns a JSON representation of the object.
- Returns:
JSON representation of the object.
- Return type:
(Dict[str, Any])
- classmethod from_json(json_dict: Dict[str, Any]) BathFitter
Initializes the object from a JSON representation.
- Parameters:
json_dict (Dict[str, Any]) – JSON representation of the object.
- _extract_execution_time(circuit: Any, device: Any) float
Extracts the execution time from the circuit.
- Parameters:
circuit (Circuit) – The quantum circuit.
device (Any) – The device containing the gate times.
- Returns:
Execution time of the circuit.
- Return type:
(float)
- execution_time_helper(device: Any, algorithm: Any, function_name: str, **kwargs) float
Helper function to calculate the execution time for a function.
- Parameters:
device (Device) – The device containing the gate times.
algorithm (Any) – the py_alqorithms algorithm to be used in the circuit creation, for which to calculate the execution time.
function_name (str) – The name of the function which requires the execution time.
kwargs (Dict[str, Any]) – The keyword arguments required for the function specified function_name.
- Returns:
Execution time of the function.
- Return type:
(float)
- fit_boson_bath_to_boson_bath(original_system: MixedLindbladOpenSystem, frequencies: ndarray, number_spins: int) Tuple[MixedLindbladOpenSystem, float | None]
Fits a model Spin-Boson system to an original Spin-Boson system.
- Parameters:
original_system (MixedLindbladOpenSystem) – The spin-boson system bath model the effective model is fitted to
frequencies (ndarray) – The frequencies for the spectral functions that is calculated from the Bosonic bath
number_spins (int) – The total number of spins in the original system
- Returns:
- The Spin-Boson system and
for constrained broadenings the fitted prefactor.
- Return type:
(MixedLindbladOpenSystem, Optional[float])
- fit_fermion_boson_system_to_fermion_boson_system(original_system: MixedLindbladOpenSystem, frequencies: ndarray, number_fermionic_modes: int) Tuple[MixedLindbladOpenSystem, float | None]
Fits a model Fermion-Boson system to an original Fermion-Boson system.
- Parameters:
original_system (MixedLindbladOpenSystem) – The fermion-boson system bath model the effective model is fitted to
frequencies (ndarray) – The frequencies for the spectral functions that is calculated from the Bosonic bath
number_fermionic_modes (int) – The total number of fermionic modes in the system
- Returns:
- The Fermion-Boson system and
for constrained broadenings the fitted prefactor.
- Return type:
(MixedLindbladOpenSystem, Optional[float])
- fit_spin_bath_to_boson_bath(original_system: MixedLindbladOpenSystem, frequencies: ndarray, number_spins: int, system_circuit_execution_time: float | None = None) Tuple[MixedHamiltonian, float | None]
Fits a model Spin-Spin system to an original Spin-Boson system.
- Parameters:
original_system (MixedLindbladOpenSystem) – The spin-boson system bath model the effective model is fitted to
frequencies (ndarray) – The frequencies for the spectral functions is calculated from the Bosonic bath
number_spins (int) – The total number of spins in the original system
system_circuit_execution_time (Optional[float]) – The execution time for the circuit that implements the time propagation of the system on the quantum computer. To match the dissipation of bosonic modes in the lab time frame to the time propagation of the system for the virtual time of a trotterstep the time the Trotter circuit needs to run on a quantum computer needs to be known. This needs to be given when the broadening constraints are not None.
- Returns:
- The Spin-Spin system and
for constrained broadenings the trotter timestep that fixes the correct broadening prefactor.
- Return type:
(MixedHamiltonian, Optional[float])
- fit_fermion_spin_system_to_fermion_boson_system(original_system: MixedLindbladOpenSystem, frequencies: ndarray, number_fermionic_modes: int, system_circuit_execution_time: float | None = None) Tuple[MixedHamiltonian, float | None]
Fits a model Fermion-Spin system to an original Fermion-Boson system.
- Parameters:
original_system (MixedLindbladOpenSystem) – The fermion-boson system bath model the effective model is fitted to
frequencies (ndarray) – The frequencies for the spectral functions is calculated from the Bosonic bath
number_fermionic_modes (int) – The total number of fermionic modes in the system
system_circuit_execution_time (Optional[float]) – The execution time for the circuit that implements the time propagation of the system on the quantum computer. To match the dissipation of bosonic modes in the lab time frame to the time propagation of the system for the virtual time of a trotterstep the time the Trotter circuit needs to run on a quantum computer needs to be known. This needs to be given when the broadening constraints are not None.
- Returns:
- The Fermion-Spin system and
for constrained broadenings the trotter timestep that fixes the correct broadening prefactor.
- Return type:
(MixedHamiltonian, Optional[float])
- fit_boson_bath_to_fermion_bath(original_system: MixedHamiltonian, temperature: float, number_frequency_points: int, number_spins: int) Tuple[Tuple[MixedLindbladOpenSystem, float | None], List[float]]
Fits a model Spin-Boson system to an original Spin-Fermion system.
- Parameters:
original_system (MixedHamiltonian) – The spin-fermion system bath model the effective model is fitted to
temperature (float) – The fermionic bath temperature assumed to obtain the spectral function
number_frequency_points (int) – The number of frequency points used to discretize the spectral function obtained from the Fermion bath
number_spins (int) – The total number of spins in the original system
- Returns:
- The Spin-Boson system,
the fitted prefactor (for constrained broadenings) and the corresponding frequencies.
- Return type:
((MixedLindbladOpenSystem, Optional[float]), List[float])
- fit_spin_bath_to_fermion_bath(original_system: MixedHamiltonian, temperature: float, number_frequency_points: int, number_spins: int, system_circuit_execution_time: float | None = None) Tuple[Tuple[MixedHamiltonian, float | None], List[float]]
Fits a model Spin-Spin system to an original Spin-Fermion system.
- Parameters:
original_system (MixedHamiltonian) – The spin-fermion system bath model the effective model is fitted to
temperature (float) – The fermionic bath temperature assumed to obtain the spectral function
number_frequency_points (int) – The number of frequency points used to discretize the spectral function opained from the Fermion bath
number_spins (int) – The total number of spins in the original system
system_circuit_execution_time (Optional[float]) – The execution time for the circuit that implements the time propagation of the system on the quantum computer. To match the dissipation of bosonic modes in the lab time frame to the time propagation of the system for the virtual time of a trotterstep the time the Trotter circuit needs to run on a quantum computer needs to be known. This needs to be given when the broadening constraints are not None.
- Returns:
- The Spin-Spin system,
the trotter timestep that fixes the correct broadening prefactor for constrained broadenings, and the corresponding frequencies.
- Return type:
((MixedHamiltonian, Optional[float]), List[float])
- fit_boson_bath_to_spectral_function(spin_system: PauliHamiltonian, spectral_function: SpinBRNoiseOperator, number_spins: int) Tuple[MixedLindbladOpenSystem, float | None]
Fits a model Spin-Boson system to a Spin spectral function.
- Parameters:
spin_system (PauliHamiltonian) – The coherent spin system for which the spectral function determines the noise
spectral_function (SpinBRNoiseOperator) – The Bloch-Redfield type spectral function that determines the decoherence in the open system the effective system is fitted to.
number_spins (int) – The total number of spins in the original system
- Returns:
- The Spin-Boson system and
for constrained broadenings the fitted prefactor.
- Return type:
(MixedLindbladOpenSystem, Optional[float])
- fit_fermion_boson_system_to_spectral_function(fermionic_system: FermionHamiltonian, spectral_function: FermionBRNoiseOperator, number_fermionic_modes: int) Tuple[MixedLindbladOpenSystem, float | None]
Fits a model Fermion-Boson system to a Fermion spectral function.
- Parameters:
fermionic_system (FermionHamiltonian) – The coherent fermion system for which the spectral function determines the noise
spectral_function (FermionBRNoiseOperator) – The Bloch-Redfield type spectral function that determines the decoherence in the open system the effective system is fitted to.
number_fermionic_modes (int) – The total number of fermionic modes in the system
- Returns:
- The Fermion-Boson system and
for constrained broadenings the fitted prefactor.
- Return type:
(MixedLindbladOpenSystem, Optional[float])
- fit_spin_bath_to_spectral_function(spin_system: PauliHamiltonian, spectral_function: SpinBRNoiseOperator, number_spins: int, system_circuit_execution_time: float | None = None) Tuple[MixedHamiltonian, float | None]
Fits a model Spin-Spin system to a Spin spectral function.
- Parameters:
spin_system (PauliHamiltonian) – The coherent spin system for which the spectral function determines the noise
spectral_function (SpinBRNoiseOperator) – The Bloch-Redfield type spectral function that determines the decoherence in the open system the effective system is fitted to.
number_spins (int) – The total number of spins in the original system
system_circuit_execution_time (Optional[float]) – The execution time for the circuit that implements the time propagation of the system on the quantum computer. To match the dissipation of bosonic modes in the lab time frame to the time propagation of the system for the virtual time of a trotterstep the time the Trotter circuit needs to run on a quantum computer needs to be known. This needs to be given when the broadening constraints are not None. It can be obtained with the HQS quantum libraries qonvert.get_execution_time function.
- Returns:
- The Spin-Spin system and
for constrained broadenings the trotter timestep that fixes the correct broadening prefactor.
- Return type:
(MixedHamiltonian, Optional[float])
- spin_bath_trotterstep_from_boson_bath(spin_boson_system: MixedLindbladOpenSystem, prefactor: float | None, system_circuit_execution_time: float | None = None) Tuple[MixedHamiltonian, float | None]
Creates Spin-Spin Hamiltonian and Trotterstep from Spin-Boson system.
Converts a Spin-Boson open system and a fitting prefactor for the Bosonic mode broadening to a Spin-Spin system and a Trotter timestep that can be used to construct a quantum circuit to simulate the Spin part of the Spin-Boson circuit with an effective bath.
- Parameters:
spin_boson_system (MixedLindbladOpenSystem) – The Spin-Boson open system that is transformed to a Spin-Spin system
prefactor (Optional[float]) – The fitted prefactor of the bosonic mode broadenings Is used to derive the Trotter timestep
system_circuit_execution_time (Optional[float]) – The execution time for the circuit that implements the time propagation of the system on the quantum computer. To match the dissipation of bosonic modes in the lab time frame to the time propagation of the system for the virtual time of a trotterstep the time the Trotter circuit needs to run on a quantum computer needs to be known. This needs to be given when the broadening constraints are not None. It can be obtained with the HQS quantum libraries qonvert.get_execution_time function.
- Returns:
- The Spin-Spin system and
for constrained broadenings the trotter timestep that fixes the correct broadening prefactor.
- Return type:
(MixedHamiltonian, Optional[float])
- _create_spin_system_from_fitting(spin_boson_system: MixedLindbladOpenSystem) MixedHamiltonian
Create a spin-spin MixedHamiltonian from a fitted spin-boson system-bath.
- Parameters:
spin_boson_system (MixedLindbladOpenSystem) – The coupling system.
- Returns:
The MixedHamiltonian with the fitted bath.
- Return type:
MixedHamiltonian
- Raises:
ValueError – Bosonic coupling operator must be given by single annihilator.
ValueError – Bath coupling of the given form is not supported.
- _create_fermion_system_from_fitting(fermion_boson_system: MixedLindbladOpenSystem) MixedHamiltonian
Create a fermion-spin MixedHamiltonian from a fitted fermion-boson system-bath.
- Parameters:
fermion_boson_system (MixedLindbladOpenSystem) – The coupling system.
- Returns:
The MixedHamiltonian with the fitted bath.
- Return type:
MixedHamiltonian
- Raises:
ValueError – Bosonic coupling operator must be given by single annihilator.
ValueError – Bath coupling of the given form is not supported.
- _check_warnings_internal_fitting(spectrum: SpinBRNoiseOperator | FermionBRNoiseOperator) None
- _constrain_broadening_widths(initial_broadenings: List[float], fit_params: Parameters) float | None
Constrains the broadening widths to be equal.
- Parameters:
initial_broadenings (List[float]) – The initial broadenings.
fit_params (Parameters) – The parameters of the model.
- _add_bath_fit_parameters(fit_params: Parameters, bosonic_frequencies: List[float], initial_broadenings: List[float], minimum_frequency_diff: float, prefactor_guess: float | None, is_spin: bool, couplings: ndarray, number_particles: int) None
- _internal_fitting(spectrum: SpinBRNoiseOperator | FermionBRNoiseOperator, coherent_system: FermionHamiltonian | PauliHamiltonian, is_spin: bool, initial_parameter_guess: Dict[str, List[float]] | None, number_particles: int) Tuple[MixedLindbladOpenSystem, float | None, Parameters]
Fits a system bath model to a spectral function of Spin-Boson model.
- Parameters:
spectrum (Union[SpinBRNoiseOperator, FermionBRNoiseOperator]) – The spectrum that the System-Bath model is fitted to.
coherent_system (Union[FermionHamiltonian, PauliHamiltonian]) – The spin system or fermionic system.
is_spin (bool) – Is the fitted system a spin system or a fermionic system.
initial_parameter_guess (Optional[Dict[str, List[float]]]) – An initial guess for the couplings.
number_particles (int) – The total number of fermionic modes or spins in the system
- Returns:
Tuple[mixed_systems.MixedLindbladOpenSystem, Optional[float], Parameters]
- Raises:
ValueError – The number of broadenings is not commensurate with the number of boson modes.
ValueError – Broadening input not recognised.
- _objective(params: Parameters, spectrum: SpinBRNoiseOperator | FermionBRNoiseOperator, number_particles: int, number_boson_modes: int, background_broadening_ratio: float, is_spin: bool) ndarray
Calculate total residual for fits of Gaussians to several data sets.
- Parameters:
params (Parameters) – The parameters of the model.
spectrum (Union[SpinBRNoiseOperator, FermionBRNoiseOperator]) – Spin/Fermion spectrum of the problem.
number_particles (int) – The number of spins or fermions in the model.
number_boson_modes (int) – The number of bosons in the model.
background_broadening_ratio (float) – Adds a constant background offset to the diagonal spectral functions when fitting. Given as a ratio of the average broadening.
is_spin (bool) – If the system is a spin system or a fermionic system.
- Returns:
residual calculated for the fits.
- Return type:
numpy.ndarray
- _params_to_spectrum(params: Parameters, frequencies: ndarray, number_particles: int, background: float, is_spin: bool) SpinBRNoiseOperator | FermionBRNoiseOperator
Construct model and extract spectrum.
- Parameters:
params (Parameters) – The parameters of the model.
frequencies (numpy.ndarray) – The frequencies.
number_particles (int) – The number of spins in the model.
number_boson_modes (int) – The number of bosons in the model.
background (float) – The constant background offset added to diagonal spectral functions.
is_spin (bool) – If the system is a spin system or a fermionic system.
- Returns:
constructed from the provided parameters.
- Return type:
Union[SpinBRNoiseOperator, FermionBRNoiseOperator]
- _prepare_initial_guess_bugfix(spectrum: SpinBRNoiseOperator | FermionBRNoiseOperator, number_particles: int, is_spin: bool) Tuple[ndarray, List[float], float]
Fits a system bath model to a spectral function of Fermion/Spin-Boson model.
- Parameters:
spectrum (SpinBRNoiseOperator) – The spectrum that the System-Bath model is fitted to.
number_particles (int) – The number of the spins in the system.
is_spin (bool) – If the system is a spin system or a fermionic system.
- Returns:
- The couplings of the resampled spectrum,
the frequencies of the input spectrum and their width.
- Return type:
Tuple[numpy.ndarray, List[float], float]
- _bath_fitter_resampling(spectrum: SpinBRNoiseOperator, number_particles: int, end_points: ndarray, is_spin: bool) Tuple[ndarray, List[float]]
- _create_spin_model(params: Parameters, spin_system: PauliHamiltonian, number_spins: int) MixedLindbladOpenSystem
Construct model and extract spectrum.
- Parameters:
params (Parameters) – The parameters of the model.
spin_system (PauliHamiltonian) – The coherent part of the system.
number_spins (int) – The total number of spins in the original system
- Returns:
created based on the model parameters.
- Return type:
MixedLindbladOpenSystem
- Raises:
ValueError – Coupling type not supported
- _create_fermionic_model(params: Parameters, fermionic_system: FermionHamiltonian, number_fermionic_modes: int) MixedLindbladOpenSystem
Construct model and extract spectrum.
- Parameters:
params (Parameters) – The parameters of the model.
fermionic_system (FermionHamiltonian) – The coherent part of the system.
number_fermionic_modes (int) – The total number of fermionic modes in the system
- Returns:
created based on the model parameters.
- Return type:
MixedLindbladOpenSystem
- Raises:
ValueError – Coupling type not supported