Stark Model
The stark model is a general implementation for the impact of an electric field applied to any other Model.
All other Model classes have an implemented apply_electric_field() method.
This model uses this method to calculate a new absorption spectrum from the effects of an electric field on the submodel’s absorption spectrum.
More details on the implementation of the Stark effect can be found in the Stark Computation Docs.
This model requires a submodel to be passed in as an argument. The submodel is the model that will be used to calculate the absorption spectrum.
Model Name
In config files, this Model is named stark. This can be specified in your-config.toml with:
model.name = "stark"
In this package, this Model is named StarkModel. This can be imported with:
from quantumspectra_2024.absorption.stark import StarkModel
Parameters
All Models have a mixture of required and optional parameters. For further explanation and expected values, see the Stark Computation Docs.
Model Parameters
Note
All Stark Models require these parameters on initialization.
An initialized neutral submodel used to calculate the absorption spectrum:
- StarkModel.neutral_submodel: AbsorptionModel
parameterized neutral submodel to use in Stark effect calculation.
Warning
The submodel must be initialized before the StarkModel. The submodel should represent neutral conditions.
These scalar paramters describe the effect of the electric field:
These scalar parameters describe the nature of the electric field:
General Parameters
All Models have optional parameters to specify the range of their generated spectrum. By default, all Models generate 2,001 points between 0 and 20,000 wavenumbers. This takes priority over the submodel’s default range.
Examples
These examples display both types of usage for this class. Both use the same “default” parameters that appear in the given sample config.
Both of these methods will produce the following absorption spectrum:
CLI Usage
First, create a config file
your-config.tomlthat includes the required specifications, and these contents:model.name = "stark" model.positive_field_strength = 0.01 model.positive_field_sum_percent = 0.5 model.field_delta_dipole = 38 model.field_delta_polarizability = 1000
Because the Stark Model requires a submodel, also include the submodel’s config:
model.neutral_submodel.name = "two_state" model.neutral_submodel.temperature_kelvin = 300 model.neutral_submodel.broadening = 200 model.neutral_submodel.transfer_integral = 100 model.neutral_submodel.energy_gap = 8000 model.neutral_submodel.mode_basis_sets = [20, 200] model.neutral_submodel.mode_frequencies = [1200, 100] model.neutral_submodel.mode_couplings = [0.7, 2.0]
More information about config files can be found on the Config Files page. Sample config files can be found in the Sample Configs section of that page.
Then, run the absorption spectrum command with the path to your config file.
qs_2024 path/to/your-config.tomlThis will save the generated absorption spectrum to the specified output file.
Package Usage
First, import the Model, and the desired submodel.
from quantumspectra_2024.models import StarkModel from quantumspectra_2024.models import TwoStateModel # or any other submodel
Create an instance of the submodel with the desired parameters.
Warning
Because the submodel is used as a parameter in the Stark model, this must be initialized first.
submodel = TwoStateModel( temperature_kelvin=300, broadening=200, transfer_integral=100, energy_gap=8000, mode_basis_sets=[20, 200], mode_frequencies=[1200, 100], mode_couplings=[0.7, 2.0] ) # or any other submodel
Create an instance of the Stark model with the desired parameters.
model = StarkModel( neutral_submodel = submodel, positive_field_strength = 0.01, positive_field_sum_percent = 0.5, field_delta_dipole = 38, field_delta_polarizability = 1000, )
Run the
get_absorptionmethod to generate the absorption spectrum.Warning
This is the cpu (or gpu)-intensive part of the process. Only run this method when you are ready to generate the absorption spectrum.
spectrum = model.get_absorption()
This will return an
AbsorptionSpectruminstance to thespectrumvariable. Details on theAbsorptionSpectrumclass can be found in the Absorption Spectrum Docs.Accessing spectrum data:
x, y = spectrum.energies, spectrum.intensities print(x) print(y)
Saving spectrum data:
spectrum.save_data("path/to/output/file.csv") spectrum.save_plot("path/to/output/plot.png")
Full Class
- class quantumspectra_2024.models.StarkModel(*, start_energy: float = 0.0, end_energy: float = 20000.0, num_points: int = 2001, neutral_submodel: AbsorptionModel, positive_field_strength: float, positive_field_sum_percent: float = 0.5, field_delta_dipole: float, field_delta_polarizability: float)[source]
A general model for Stark absorption spectrum.
- Parameters:
- start_energyfloat
absorption spectrum’s starting energy (wavenumbers).
- end_energyfloat
absorption spectrum’s ending energy (wavenumbers).
- num_pointsint
absorption spectrum’s number of points (unitless).
- neutral_submodelModel
parameterized neutral submodel to use in Stark effect calculation.
- positive_field_strengthfloat
positive strength of the electric field.
- positive_field_sum_percentfloat
fraction of positive field strength to use in spectrum (decimal). negative field strength is 1 - this value.
- field_delta_dipolefloat
change in dipole moment due to electric field.
- field_delta_polarizabilityfloat
change in polarizability due to electric field.
Methods
Compute the absorption spectrum for the model.
get_charged_submodel(field_strength_scalar)Returns a charged submodel with the Stark effect applied.
Returns the netural submodel with the Stark effect applied.
- get_absorption() AbsorptionSpectrum[source]
Compute the absorption spectrum for the model.
First computes absorption spectrum for the neutral submodel, and then for the charged submodels. Two charged submodels are computed, one with positive field strength and one with negative field strength.
A half-sum is computed between the two charged submodels, with each submodel’s intensities scaled by positive_field_sum_percent and 1 - positive_field_sum_percent, respectively.
Then, the neutral intensities are subtracted from the charged half-sum to get the electroabsorption spectrum.
- Returns:
- AbsorptionSpectrum
the model’s parameterized absorption spectrum.
- get_neutral_submodel() AbsorptionModel[source]
Returns the netural submodel with the Stark effect applied.
This method replaces the neutral submodel’s point values with the Stark model’s point values. No other changes are made to the neutral submodel.
- Returns:
- Model
the neutral submodel for Stark calculations.
- get_charged_submodel(field_strength_scalar: float) AbsorptionModel[source]
Returns a charged submodel with the Stark effect applied.
This method starts with the neutral submodel from get_neutral_submodel and applies the Stark effect. The Stark effect is applied through the Model’s apply_electric_field method. Field strength is multiplied by field_strength_scalar, and all other values are inputted into the method exactly.
- Parameters:
- field_strength_scalarfloat
scalar to multiply the field strength by.
- Returns:
- Model
the charged submodel for Stark calculations.