bath_mapper

HQS python tool for the Qexa project

Copyright © 2021-2023 HQS Quantum Simulations GmbH. All Rights Reserved.

Licensed under Vertrag über die Lieferung und Integration von Quantensoftware, Transaction 09222115557459117503 signed 12.12.2021. All conditions and limitations stated in Vertrag über die Lieferung und Integration von Quantensoftware, Transaction 09222115557459117503 apply.

SpinBRNoiseOperator(frequencies)

A general struct encoding a spectral function coupled to a spin system.

FermionBRNoiseOperator(frequencies)

A general struct encoding a spectral function coupled to a fermion system.

spectral_function_to_coupling(...)

Convert a spectral function to a physical coupling as described by a Spin-Boson-System or Fermion-Boson-System.

coupling_to_spectral_function(...[, ...])

Convert a physical coupling as described by a spin/fermion system coupled to a bosonic bath to a spectral function.

calculate_excitation_spectral_function(...)

Determine the bath excitation spectral function from a given Hamiltonian.

linear_chain_optimisation

Linear chain optimisation module

Functions

calculate_excitation_spectral_function(...)

Determine the bath excitation spectral function from a given Hamiltonian.

coupling_to_spectral_function(...[, ...])

Convert a physical coupling as described by a spin/fermion system coupled to a bosonic bath to a spectral function.

integrate_over_frequency_intervals(...)

Integrate a collection of spectral functions (represented by a SpinNoiseBROperator or a FermionBRNoiseOperator) over a set of input frequencies.

spectral_function_to_coupling(...)

Convert a spectral function to a physical coupling as described by a Spin-Boson-System or Fermion-Boson-System.

Classes

BathFitter(number_boson_modes)

Utility for fitting effective open quantum systems to original open quantum systems.

FermionBRNoiseOperator(frequencies)

A general struct encoding a spectral function coupled to a fermion system.

SpinBRNoiseOperator(frequencies)

A general struct encoding a spectral function coupled to a spin system.

class bath_mapper.BathFitter(number_boson_modes)

Utility for fitting effective open quantum systems to original open quantum systems.

background_broadening_ratio(ratio)

Set the background broadening ratio.

broad_coupling_types(coupling_types)

Set broad coupling types.

broadening_constraint(constraint=None)

Set the broadening constraint.

fit_boson_bath_to_boson_bath(original_system, frequencies)

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

Returns:

The Spin-Boson system and

for constrained broadenings the fitted prefactor.

Return type:

(MixedHamiltonianSystem, Optional[float])

fit_boson_bath_to_fermion_bath(original_system, temperature, number_frequency_points)

Fits a model Spin-Boson system to an original Spin-Fermion system.

Parameters:
  • original_system (MixedHamiltonianSystem) -- The spin-fermion system bath model the effective model is fitted to

  • temperature (float) -- The fermionic bath temperature assumed to obtain the spectral funtion

  • number_frequency_points (int) -- The number of frequency points used to discretize the spectral function obtained from the Fermion bath

Returns:

The Spin-Boson system and

for constrained broadenings the fitted prefactor.

Return type:

(MixedHamiltonianSystem, Optional[float])

fit_boson_bath_to_spectral_function(spin_system, spectral_function)

Fits a model Spin-Boson system to an original Spin-Fermion system.

# Arguments

  • spin_system - The coherent spin system for which the

    spectral function determines the noise

  • spectral_function - The Bloch-Redfield type spectral function

    that determines the decoherence in the open system the effective system is fitted to.

# Returns

Ok(spin-boson-system, prefactor): The Spin-Boson system and

for constrained broadenings the fitted prefactor.

fit_spin_bath_to_boson_bath(noise_app, original_system, frequencies, device)

Fits a model Spin-Spin system to an original Spin-Boson system.

Parameters:
  • noise_app (HqsNoiseApp) -- The noise app used to construct simulation programs from the result of the fitting

  • 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

  • device (Device) -- The qoqo device on which the spin-spin system bath model should be simulated. Used to calculate the circuit depth necessary to determine the Trotter timestep

Returns:

The Spin-Spin system and

for constrained broadenings the trotter timestep that fixes the correct broadening prefactor.

Return type:

(MixedHamiltonianSystem, Optional[float])

fit_spin_bath_to_fermion_bath(noise_app, original_system, temperature, number_frequency_points, device)

Fits a model Spin-Spin system to an original Spin-Boson system.

Parameters:
  • noise_app (HqsNoiseApp) -- The noise app used to construct simulation programs from the result of the fitting

  • 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

  • device (Device) -- The qoqo device on which the spin-spin system bath model should be simulated. Used to calculate the circuit depth necessary to determine the Trotter timestep

Returns:

The Spin-Spin system and

for constrained broadenings the trotter timestep that

fixes the correct broadening

prefactor.

Return type:

(MixedHamiltonianSystem, Optional[float])

fit_spin_bath_to_spectral_function(noise_app, spin_system, spectral_function, device)

Fits a model Spin-Spin system to an original Spin-Fermion system.

Parameters:
  • noise_app (HqsNoiseApp) -- The noise app used to construct simulation programs from the result of the fitting

  • spin_system (SpinHamiltonianSystem) -- 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.

  • device (Device) -- The qoqo device on which the spin-spin system bath model should be simulated. Used to calculate the circuit depth necessary to determine the Trotter timestep

Returns:

The Spin-Spin system and

for constrained broadenings the trotter timestep that fixes the correct broadening prefactor.

Return type:

(MixedHamiltonianSystem, Optional[float])

fitting_window(window=None)

Set fitting window.

is_lmfit_module_loaded()

Check if the lmfit module is loaded.

load_lmfit_module()

Automatically load the lmfit module if it is not already loaded.

Returns:

  • Ok(Self) - The BathFitter with the lmfit module set.

  • Err(BathMapperError) - If the lmfit module could not be loaded.

maximum_eigenfrequencies(maximum_frequencies=None)

Set maximum eigenfrequencies.

minimum_eigenfrequencies(minimum_frequencies=None)

Set minimum eigenfrequencies.

set_lmfit_module(lmfit_module)

Set the lmfit module to allow using python fitting routines.

Useful when using virtual environments where module cannot be loaded automatically but needs to the passed in manually from python.

Parameters:

lmfit_module -- The Python lmfit module.

Returns:

The BathFitter with the lmfit module set.

spins_per_bosonic_mode(number_spins)

Set the number of spins per bosonic mode.

class bath_mapper.FermionBRNoiseOperator(frequencies)

A general struct encoding a spectral function coupled to a fermion system.

Can be used for many cases where a continuous function is coupled to a FermionSystem by up to two fermion operators.

Examples include:

  • The Bloch-Redfield spectral function

  • The effective temperature of a spectral function

Parameters:

frequencies (List[float]) -- The frequencies on which the spectral functions are defined

static current_version()

Returns the current version of the bath-mapper-py library .

Returns:

The current version of the library.

Return type:

str

frequencies()

Get the frequencies the spectral function is defined for.

Returns:

The start and end points of the frequencies.

Return type:

List[float]

from_bincode()

Convert the bincode representation of the FermionBRNoiseOperator to a FermionBRNoiseOperator using the [bincode] crate.

Parameters:

input (ByteArray) -- The serialized FermionBRNoiseOperator (in [bincode] form).

Returns:

The deserialized FermionBRNoiseOperator.

Return type:

FermionBRNoiseOperator

Raises:
  • TypeError -- Input cannot be converted to byte array.

  • ValueError -- Input cannot be deserialized to FermionBRNoiseOperator.

from_json()

Convert the json representation of a FermionBRNoiseOperator to a FermionBRNoiseOperator.

Parameters:

input (str) -- The serialized FermionBRNoiseOperator in json form.

Returns:

The deserialized FermionBRNoiseOperator.

Return type:

FermionBRNoiseOperator

Raises:

ValueError -- Input cannot be deserialized to FermionBRNoiseOperator.

get()

Get the spectral function for a pair of FermionProducts.

Parameters:

key (string, string) -- The string representation of the pair of FermionProducts for which to get the spectral function.

Returns:

The spectral function for the input key.

Return type:

List[complex]

Raises:
  • ValueError -- Could not convert left key input to FermionProduct.

  • ValueError -- Could not convert right key input to FermionProduct.

get_imag()

Get the imaginary part of the spectral function for a pair of FermionProducts.

Parameters:

key (string, string) -- The string representation of the pair of FermionProducts for which to get the spectral function.

Returns:

The imaginary part of the spectral function for the input key.

Return type:

List[float]

Raises:
  • ValueError -- Could not convert left key input to FermionProduct.

  • ValueError -- Could not convert right key input to FermionProduct.

get_real()

Get the real part of the spectral function for a pair of FermionProducts.

Parameters:

key (string, string) -- The string representation of the pair of FermionProducts for which to get the spectral function.

Returns:

The real part of the spectral function for the input key.

Return type:

List[float]

Raises:
  • ValueError -- Could not convert left key input to FermionProduct.

  • ValueError -- Could not convert right key input to FermionProduct.

get_spectral_function_matrix(number_fermions)

Get the matrix of the spectral function of a fermion-system at a specific energy index.

Assumes that the FermionBRNoiseOperator represents the spectral function coupled to a fermion system. A real spectral function needs to be symmetric in the coupling indices. The method will fail if the FermionBRNoiseOperator is not symmetric.

Parameters:
  • spectral_function_index (int) -- The frequency index for which the matrix is returned

  • number_fermions (int) -- The number of fermions in the system.

Returns:

the resulting complex matrix representation of the spectral function at the specified energy index.

Return type:

np.ndarray

Raises:

ValueError -- Spectral function matrix is not symmetric.

static json_schema()

Return the JsonSchema for the json serialisation of the class.

Returns:

The json schema serialized to json

Return type:

str

min_supported_version()

Return the minimum version of bath-mapper-py that supports this object.

Returns:

The minimum version of the bath-mapper-py library to deserialize this object.

Return type:

str

resample()

Resample the FermionBRNoiseOperator on a new set of frequencies.

The function makes the base assumption that the spectra are flat within each bin corresponding to the original frequencies. To resample the original function is integrated and interpolated at the new frequencies.

Parameters:

frequencies (List[float]) -- The new frequencies for which every datapoint in the spectral function is defined.

Returns:

The resampled FermionBRNoiseOperator.

Return type:

FermionBRNoiseOperator

Raises:

ValueError -- Cannot use resample_interpolate to extrapolate. Current minimum frequency is larger than new minimum frequency.

resample_interpolate()

Resample the FermionBRNoiseOperator on a new set of frequencies by linear interpolation.

Parameters:

frequencies (List[float]) -- The new frequencies for which every datapoint in the spectral function is defined.

Returns:

The resampled FermionBRNoiseOperator.

Return type:

FermionBRNoiseOperator

Raises:

ValueError -- Cannot use resample_interpolate to extrapolate. Current minimum frequency is larger than new minimum frequency.

set(spectral_function, /)

Set the value of a spectral function for the input frequencies and a set of FermionProduct.

Parameters:
  • key (string, string) -- The string representation of the pair of FermionProducts for which to set the spectral function.

  • spectral_function (List[float]) -- The frequency resolved spectral function as a vector of complex numbers.

Raises:
  • ValueError -- Could not convert left key input to FermionProduct.

  • ValueError -- Could not convert right key input to FermionProduct.

  • ValueError -- Spectral function must define a value for each frequency.

set_imag(spectral_function, /)

Set the imaginary part of the value of a spectral function for the input frequencies and a set of FermionProducts.

Parameters:
  • key (string, string) -- The string representation of the pair of FermionProducts for which to set the spectral function.

  • spectral_function (List[float]) -- The frequency resolved spectral function as a vector of complex numbers.

Raises:
  • ValueError -- Could not convert left key input to FermionProduct.

  • ValueError -- Could not convert right key input to FermionProduct.

  • ValueError -- Spectral function must define a value for each frequency.

set_real(spectral_function, /)

Set the real part of the value of a spectral function for the input frequencies and a set of FermionProducts.

Parameters:
  • key (string, string) -- The string representation of the pair of FermionProducts for which to set the spectral function.

  • spectral_function (List[float]) -- The frequency resolved spectral function as a vector of complex numbers.

Raises:
  • ValueError -- Could not convert left key input to FermionProduct.

  • ValueError -- Could not convert right key input to FermionProduct.

  • ValueError -- Spectral function must define a value for each frequency.

to_bincode()

Return the bincode representation of the FermionBRNoiseOperator using the [bincode] crate.

Returns:

The serialized FermionBRNoiseOperator (in [bincode] form).

Return type:

ByteArray

Raises:

ValueError -- Cannot serialize FermionBRNoiseOperator to bytes.

to_json()

Return the json representation of the FermionBRNoiseOperator.

Returns:

The serialized form of FermionBRNoiseOperator.

Return type:

str

Raises:

ValueError -- Cannot serialize FermionBRNoiseOperator to json.

class bath_mapper.SpinBRNoiseOperator(frequencies)

A general struct encoding a spectral function coupled to a spin system.

Can be used for many cases where a continuous function is coupled to a SpinSystem by up to two spin operators.

Examples include:

  • The Bloch-Redfield spectral function

  • The effective temperature of a spectral function#[pyclass(name = "SpinBRNoiseOperator", module = "bath_mapper")]

Parameters:

frequencies (List[float]) -- The frequencies on which the spectral functions are defined

static current_version()

Returns the current version of the bath-mapper-py library .

Returns:

The current version of the library.

Return type:

str

frequencies()

Get the frequencies the spectral function is defined for.

Returns:

The start and end points of the frequencies.

Return type:

List[float]

from_bincode()

Convert the bincode representation of the SpinBRNoiseOperator to a SpinBRNoiseOperator using the [bincode] crate.

Parameters:

input (ByteArray) -- The serialized SpinBRNoiseOperator (in [bincode] form).

Returns:

The deserialized SpinBRNoiseOperator.

Return type:

SpinBRNoiseOperator

Raises:
  • TypeError -- Input cannot be converted to byte array.

  • ValueError -- Input cannot be deserialized to SpinBRNoiseOperator.

from_json()

Convert the json representation of a SpinBRNoiseOperator to a SpinBRNoiseOperator.

Parameters:

input (str) -- The serialized SpinBRNoiseOperator in json form.

Returns:

The deserialized SpinBRNoiseOperator.

Return type:

SpinBRNoiseOperator

Raises:

ValueError -- Input cannot be deserialized to SpinBRNoiseOperator.

get()

Get the spectral function for a pair of PauliProducts.

Parameters:

key (string, string) -- The string representation of the pair of PauliProducts for which to get the spectral function.

Returns:

The spectral function functionum for the input key.

Return type:

List[complex]

Raises:
  • ValueError -- Could not convert left key input to PauliProduct.

  • ValueError -- Could not convert right key input to PauliProduct.

get_imag()

Get the imaginary part of the spectral function for a pair of PauliProducts.

Parameters:

key (string, string) -- The string representation of the pair of PauliProducts for which to get the spectral function.

Returns:

The imaginary part of the spectral function for the input key.

Return type:

List[float]

Raises:
  • ValueError -- Could not convert left key input to PauliProduct.

  • ValueError -- Could not convert right key input to PauliProduct.

get_real()

Get the real part of the spectral function for a pair of PauliProducts.

Parameters:

key (string, string) -- The string representation of the pair of PauliProducts for which to get the spectral function.

Returns:

The real part of the spectral function for the input key.

Return type:

List[float]

Raises:
  • ValueError -- Could not convert left key input to PauliProduct.

  • ValueError -- Could not convert right key input to PauliProduct.

get_spectral_function_matrix(number_spins)

Get the matrix of the spectral function of a spin-system at a specific energy index.

Assumes that the SpinBRNoiseOperator represents the spectral function coupled to a spin system. A real spectral function needs to be symmetric in the coupling indices. The method will fail if the SpinBRNoiseOperator is not symmetric.

Parameters:
  • spectral_function_index (int) -- The frequency index for which the matrix is returned

  • number_spins (int) -- The number of spins in the system.

Returns:

the resulting complex matrix representation of the spectral function at the specified energy index.

Return type:

np.ndarray

Raises:

ValueError -- Spectral function matrix is not symmetric.

static json_schema()

Return the JsonSchema for the json serialisation of the class.

Returns:

The json schema serialized to json.

Return type:

str

min_supported_version()

Return the minimum version of bath-mapper-py that supports this object.

Returns:

The minimum version of the bath-mapper-py library to deserialize this object.

Return type:

str

resample()

Resample the SpinBRNoiseOperator on a new set of frequencies.

The function makes the base assumption that the spectra are flat within each bin corresponding to the original frequencies. To resample the original function is integrated and interpolated at the new frequencies.

Parameters:

frequencies (List[float]) -- The new frequencies for which every datapoint in the spectral function is defined.

Returns:

The resampled SpinBRNoiseOperator.

Return type:

SpinBRNoiseOperator

Raises:

ValueError -- Cannot use resample_interpolate to extrapolate. Current minimum frequency is larger than new minimum frequency.

resample_interpolate()

Resample the SpinBRNoiseOperator on a new set of frequencies by linear interpolation.

Parameters:

frequencies (List[float]) -- The new frequencies for which every datapoint in the spectral function is defined.

Returns:

The resampled SpinBRNoiseOperator.

Return type:

SpinBRNoiseOperator

Raises:

ValueError -- Cannot use resample_interpolate to extrapolate. Current minimum frequency is larger than new minimum frequency.

set(spectral_function, /)

Set the value of a spectral function for the input frequencies and a set of PauliProducts.

Parameters:
  • key (string, string) -- The string representation of the pair of PauliProducts for which to set the spectral function.

  • spectral_function (List[float]) -- The frequency resolved spectral function as a vector of complex numbers.

Raises:
  • ValueError -- Could not convert left key input to PauliProduct.

  • ValueError -- Could not convert right key input to PauliProduct.

  • ValueError -- Spectral function must define a value for each frequency.

set_imag(spectral_function, /)

Set the imaginary part of the value of a spectral function for the input frequencies and a set of PauliProducts.

Parameters:
  • key (string, string) -- The string representation of the pair of PauliProducts for which to set the spectral function.

  • spectral_function (List[float]) -- The frequency resolved spectral function as a vector of complex numbers.

Raises:
  • ValueError -- Could not convert left key input to PauliProduct.

  • ValueError -- Could not convert right key input to PauliProduct.

  • ValueError -- Spectral function must define a value for each frequency.

set_real(spectral_function, /)

Set the real part of the value of a spectral function for the input frequencies and a set of PauliProducts.

Parameters:
  • key (string, string) -- The string representation of the pair of PauliProducts for which to set the spectral function.

  • spectral_function (List[float]) -- The frequency resolved spectral function as a vector of complex numbers.

Raises:
  • ValueError -- Could not convert left key input to PauliProduct.

  • ValueError -- Could not convert right key input to PauliProduct.

  • ValueError -- Spectral function must define a value for each frequency.

to_bincode()

Return the bincode representation of the SpinBRNoiseOperator using the [bincode] crate.

Returns:

The serialized SpinBRNoiseOperator (in [bincode] form).

Return type:

ByteArray

Raises:

ValueError -- Cannot serialize SpinBRNoiseOperator to bytes.

to_json()

Return the json representation of the SpinBRNoiseOperator.

Returns:

The serialized form of SpinBRNoiseOperator.

Return type:

str

Raises:

ValueError -- Cannot serialize SpinBRNoiseOperator to json.

bath_mapper.calculate_excitation_spectral_function(mode_fermion_system, temperature, number_frequencies=None)

Determine the bath excitation spectral function from a given Hamiltonian.

If the system of the mixed Hamiltonian is a spin system: Core has arbitrary many spins and bath has free electrons, and spin-bath operator is of the form: t_sij * sigma_s * c_dag_i c_j, with summation over s, i, j and where sigma_s is a spin operator built from the X, Y, Z Pauli operators. We do not (need to) keep track of electron-spin transitions. Also the actual spin-operator can be sigma_s^-, sigma_s^+, or sigma_sz, but is not specified.

If the system of the mixed Hamiltonian is a fermionic system: Core has arbitrary many fermions and bath has free electrons, and system-bath operator is of the form: t_ijkl * c_dag_i c_j * c_dag_k c_l, with summation over i, j, k, l and where c_dag_i c_j is a system term and c_dag_k c_l is a bath term. We do not (need to) keep track of electron-system transitions.

Parameters:
  • mode_fermion_system (MixedHamiltonianSystem) -- A MixedHamiltonianSystem composed of a spin/fermion system coupled to a noninteracting fermionic bath.

  • temperature (float) -- Bath temperature. Enters later via fermi distributions of bath.

  • number_frequencies (int) -- The number of frequency points on which the excitation spectral function is calculated. Defaults to 100.

Returns:

(BRNoiseOperator, List[float]) - The SpinBRNoiseOperator/FermionBRNoiseOperator and corresponding frequencies from the input.

Raises:
  • ValueError -- Could not convert mode_fermion_system to MixedHamiltonianSystem.

  • ValueError -- The incorrect number of spin/fermion subsystems have been specified.

  • ValueError -- The temperature input is not valid, as it is negative.

  • ValueError -- No interaction between system and bath. Cannot construct spectral function.

  • ValueError -- calculate_excitation_spectral_function only supports uniform coupling types.

  • ValueError -- This function cannot be run with symbolic values in the Hamiltonian.

bath_mapper.coupling_to_spectral_function(mode_boson_system, frequencies, background=None, additional_damping=None, allow_empty_coupling=None)

Convert a physical coupling as described by a spin/fermion system coupled to a bosonic bath to a spectral function.

If the system part of the input MixedLindbladOpenSystem is a spin system, the MixedLindbladOpenSystem should adhere to the following assumptions: * The coherent system terms can be of any form as they are not taken into account here. * The coherent pure bosonic (bath) terms should be interaction-free, and should therefore only be of the form (omega * b^dagger b). * The coherent coupling terms between system and bath should be limited to one single Pauli operator coupling to a single bosonic creation operator

plus its hermitian conjugate: (sigma_{x, y, z} * (b + b^dagger)).

  • The noise terms should only act on the bosonic bath and should be limited to pure damping.

If the system part of the input MixedLindbladOpenSystem is a fermionic system, the MixedLindbladOpenSystem should adhere to the following assumptions: * The coherent system terms can be of any form as they are not taken into account here. * The coherent pure bosonic (bath) terms should be interaction-free, and should therefore only be of the form (omega * b^dagger b). * The coherent coupling terms between system and bath should be limited to c_i a_j operator coupling to a single bosonic creation operator

plus its hermitian conjugate: (c_i a_j * (b + b^dagger)).

  • The noise terms should only act on the bosonic bath and should be limited to pure damping.

Parameters:
  • mode_boson_system (MixedLindbladOpenSystem) -- A struqture_py coupled open spin-boson system or fermion-boson system in the form of a MixedLindbladOpenSystem. The coupling between fermion/spin and bosonic subsystem is limited to one single Pauli operator (in the case of a SpinBRNoiseOperator) or a c_i a_j operator (in the case of a FermionBRNoiseOperator) coupling to a single bosonic creation operator plus its Hermitian conjugate. The bosonic subsystem is limited to an interaction-free system, with the eigenfrequencies directly given by the coefficients of the occupation operators in the Hamiltonian (omega * b^dagger b). The Lindblad terms of the open system can only act on the bosonic subsystem and are limited to pure damping.

  • frequencies (List[float]) -- The frequencies for which every datapoint in the spectral function is defined.

  • background (Optional[float]) -- A constant background/offset that is included in the on-diagonal spectral functions. Defaults to 0.0

  • additional_damping (Optional[float]) -- An optional constant damping to be added to the one calculated from the open system.

  • allow_empty_coupling (Optional[bool]) -- Allow a mixed system input with no coupling between subsystems.Will produce a zero spectral function.

Returns:

The calculated spectral function.

Return type:

BRNoiseOperator

Raises:
  • ValueError -- Frequencies must increase monotonically.

  • ValueError -- The coupling type has been incorrectly specified.

  • ValueError -- Spectral function must define a value for each frequency.

  • ValueError -- Could not construct the products needed to index the mode_boson_system.

bath_mapper.integrate_over_frequency_intervals(spectral_function, new_frequencies)

Integrate a collection of spectral functions (represented by a SpinNoiseBROperator or a FermionBRNoiseOperator) over a set of input frequencies.

Parameters:
  • spectral_function (Union[SpinBRNoiseOperator, FermionBRNoiseOperator]) -- The spectral functions to integrate.

  • new_frequencies (List[float]) -- The frequencies over which to integrate the spectral functions.

Returns:

The resulting BRNoiseOperator.

Return type:

Union[SpinBRNoiseOperator, FermionBRNoiseOperator]

Raises:
  • ValueError -- Could not convert the input to either SpinBRNoiseNoiseOperator or FermionBRNoiseOperator.

  • ValueError -- Error in integration.

bath_mapper.spectral_function_to_coupling(spectral_function, number_modes)

Convert a spectral function to a physical coupling as described by a Spin-Boson-System or Fermion-Boson-System.

If the input spectral function is a SpinBRNoiseOperator, the MixedLindbladOpenSystem constructed has one spin subsystem (with number_modes spins) and 3 * number_modes bosonic subsystems each with frequencies.len() modes. This is because each spin is coupled to 3 bosonic baths, one for each of the X, Y, Z couplings. Additionally, each energy interval (and therefore each frequency) contains one bosonic mode. If the input spectral function is a FermionBRNoiseOperator, the MixedLindbladOpenSystem constructed has one fermionic subsystem (with number_modes fermions) and number_modes * number_modes bosonic subsystems each with frequencies.len() modes. This is because each fermion is coupled to number_modes bosonic baths, as c0 can couple to all a0...aN terms. Additionally, each energy interval (and therefore each frequency) contains one bosonic mode.

Parameters:
  • spectral_function (Union[SpinBRNoiseOperator, FermionBRNoiseOperator]) -- A set of spectral functions for number_modes baths, represented by either a SpinBRNoiseOperator or a FermionBRNoiseOperator.

  • number_modes (int) -- The number of the spins or fermions in the system.

Returns:

The successfully converted spectral function as as MixedLindbladOpenSystem.

Return type:

MixedLindbladOpenSystem

Raises:
  • ValueError -- Spectral function matrix is not symmetric.

  • ValueError -- Could not construct MixedLindbladOpenSystem.