Skip to content

Quantum Oscillations

quantum_oscillations

This module provides functions for analyzing quantum oscillation data. It includes calculations for extremal areas and frequencies, damping factors (Lifshitz-Kosevich and Dingle), effective mass fitting, and Fast Fourier Transform analysis of quantum oscillation signals.

dingle_damping_factor(magnetic_field, effective_mass, lifetime, harmonic=1)

Calculate the Dingle damping factor for quantum oscillations.

Parameters:

Name Type Description Default
magnetic_field float

Magnetic field in Tesla.

required
effective_mass float

Effective mass in units of the electron mass.

required
lifetime float

Dingle lifetime in seconds.

required
harmonic int

Harmonic number. Defaults to 1.

1

Returns:

Name Type Description
float

Dingle damping factor.

Source code in src/quantalyze/quantum_oscillations.py
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
def dingle_damping_factor(magnetic_field: float, effective_mass: float, lifetime: float, harmonic: int = 1):
    """
    Calculate the Dingle damping factor for quantum oscillations.

    Args:
        magnetic_field (float): Magnetic field in Tesla.
        effective_mass (float): Effective mass in units of the electron mass.
        lifetime (float): Dingle lifetime in seconds.
        harmonic (int, optional): Harmonic number. Defaults to 1.

    Returns:
        float: Dingle damping factor.
    """
    cyclotron_mass = effective_mass * ELECTRON_MASS
    cylcotron_frequency = ELEMENTARY_CHARGE * magnetic_field / cyclotron_mass
    return exp(- (PI * harmonic) / (cylcotron_frequency * lifetime))

dingle_lifetime(dingle_temperature)

Calculate the Dingle lifetime from the Dingle temperature.

Parameters:

Name Type Description Default
dingle_temperature float

Dingle temperature in Kelvin.

required

Returns:

Name Type Description
float

Dingle lifetime in seconds.

Source code in src/quantalyze/quantum_oscillations.py
60
61
62
63
64
65
66
67
68
69
70
def dingle_lifetime(dingle_temperature: float):
    """
    Calculate the Dingle lifetime from the Dingle temperature.

    Args:
        dingle_temperature (float): Dingle temperature in Kelvin.

    Returns:
        float: Dingle lifetime in seconds.
    """
    return REDUCED_PLANCK_CONSTANT / (2 * PI * BOLTZMANN_CONSTANT * dingle_temperature)

dingle_temperature(dingle_lifetime)

Calculate the Dingle temperature from the Dingle lifetime.

Parameters:

Name Type Description Default
dingle_lifetime float

Dingle lifetime in seconds.

required

Returns:

Name Type Description
float

Dingle temperature in Kelvin.

Source code in src/quantalyze/quantum_oscillations.py
73
74
75
76
77
78
79
80
81
82
83
def dingle_temperature(dingle_lifetime: float):
    """
    Calculate the Dingle temperature from the Dingle lifetime.

    Args:
        dingle_lifetime (float): Dingle lifetime in seconds.

    Returns:
        float: Dingle temperature in Kelvin.
    """
    return REDUCED_PLANCK_CONSTANT / (2 * PI * BOLTZMANN_CONSTANT * dingle_lifetime)

extremal_area(frequency)

Calculate the extremal area from the frequency of quantum oscillations.

Parameters:

Name Type Description Default
frequency float

Frequency in Tesla.

required

Returns:

Name Type Description
float

Extremal area in units of m^-2.

Source code in src/quantalyze/quantum_oscillations.py
15
16
17
18
19
20
21
22
23
24
25
def extremal_area(frequency: float):
    """
    Calculate the extremal area from the frequency of quantum oscillations.

    Args:
        frequency (float): Frequency in Tesla.

    Returns:
        float: Extremal area in units of m^-2.
    """
    return frequency * (2 * PI * ELEMENTARY_CHARGE) / REDUCED_PLANCK_CONSTANT

extremal_frequency(area)

Calculate the extremal frequency from the extremal area.

Parameters:

Name Type Description Default
area float

Extremal area in units of m^-2.

required

Returns:

Name Type Description
float

Frequency in Tesla.

Source code in src/quantalyze/quantum_oscillations.py
28
29
30
31
32
33
34
35
36
37
38
def extremal_frequency(area: float):
    """
    Calculate the extremal frequency from the extremal area.

    Args:
        area (float): Extremal area in units of m^-2.

    Returns:
        float: Frequency in Tesla.
    """
    return (REDUCED_PLANCK_CONSTANT * area) / (2 * PI * ELEMENTARY_CHARGE)

fft(df, field_column, signal_column, minimum_field, maximum_field, points, background_function, window=Window.HANN, subtract_inverse_field=False)

Perform a Fast Fourier Transform (FFT) on the quantum oscillation data.

Parameters:

Name Type Description Default
df DataFrame

DataFrame containing quantum oscillation data.

required
field_column str

Name of the column containing magnetic field data.

required
signal_column str

Name of the column containing signal data.

required
minimum_field float

Minimum magnetic field in Tesla.

required
maximum_field float

Maximum magnetic field in Tesla.

required
points int

Number of points for the FFT.

required
background_function callable

Function to model the background.

required
window Window

Window function to apply to the data. Defaults to Window.HANN.

HANN
subtract_inverse_field bool

Whether to subtract the inverse field. Defaults to False.

False

Returns:

Type Description

pandas.DataFrame: DataFrame containing the FFT results.

Source code in src/quantalyze/quantum_oscillations.py
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
def fft(
    df: pd.DataFrame,
    field_column: str,
    signal_column: str,
    minimum_field: float,
    maximum_field: float,
    points: int,
    background_function: callable,
    window: Window = Window.HANN,
    subtract_inverse_field: bool =False,
):
    """
    Perform a Fast Fourier Transform (FFT) on the quantum oscillation data.

    Args:
        df (pandas.DataFrame): DataFrame containing quantum oscillation data.
        field_column (str): Name of the column containing magnetic field data.
        signal_column (str): Name of the column containing signal data.
        minimum_field (float): Minimum magnetic field in Tesla.
        maximum_field (float): Maximum magnetic field in Tesla.
        points (int): Number of points for the FFT.
        background_function (callable): Function to model the background.
        window (Window, optional): Window function to apply to the data. Defaults to Window.HANN.
        subtract_inverse_field (bool, optional): Whether to subtract the inverse field. Defaults to False.

    Returns:
        pandas.DataFrame: DataFrame containing the FFT results.
    """

    data = df.copy()
    data = data[[field_column, signal_column]].dropna()
    data = data[(data[field_column] >= minimum_field) & (data[field_column] <= maximum_field)]
    data['inverse_field'] = 1 / data[field_column]

    if subtract_inverse_field:
        data['subtracted'] = data[signal_column] - background_function(data['inverse_field'])
    else:
        data['subtracted'] = data[signal_column] - background_function(data[field_column])

    result = qz_fft(
        data,
        x_column='inverse_field',
        y_column='subtracted',
        window=window,
        n=points,
    )

    return result

fit_effective_mass(df, temperature_column, amplitude_column, magnetic_field, harmonic=1, p0=None)

Fit the effective mass from quantum oscillation data.

Parameters:

Name Type Description Default
df DataFrame

DataFrame containing quantum oscillation data.

required
temperature_column str

Name of the column containing temperature data.

required
amplitude_column str

Name of the column containing amplitude data.

required
magnetic_field float

Magnetic field in Tesla.

required
harmonic int

Harmonic number. Defaults to 1.

1
p0 list

Initial guess for the fit parameters. Defaults to None.

None

Returns:

Name Type Description
float

Effective mass in units of the electron mass.

Source code in src/quantalyze/quantum_oscillations.py
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
def fit_effective_mass(
    df: pd.DataFrame, 
    temperature_column: str, 
    amplitude_column: str, 
    magnetic_field: float, 
    harmonic: int = 1, 
    p0: list = None,
):
    """
    Fit the effective mass from quantum oscillation data.

    Args:
        df (pandas.DataFrame): DataFrame containing quantum oscillation data.
        temperature_column (str): Name of the column containing temperature data.
        amplitude_column (str): Name of the column containing amplitude data.
        magnetic_field (float): Magnetic field in Tesla.
        harmonic (int, optional): Harmonic number. Defaults to 1.
        p0 (list, optional): Initial guess for the fit parameters. Defaults to None.

    Returns:
        float: Effective mass in units of the electron mass.
    """

    def model(temperature, prefactor, effective_mass):
        return prefactor * lifshitz_kosevich_damping_factor(temperature, magnetic_field, effective_mass, harmonic)

    if p0 is None:
        initial_amplitude = df[amplitude_column].max()
        initial_mass = 1
        p0 = [initial_amplitude, initial_mass]

    f = fit(
        model,
        df, 
        x_column=temperature_column,
        y_column=amplitude_column,
        bounds=([0, 0], [inf, inf]),
        p0=p0,
    )

    return f

lifshitz_kosevich_damping_factor(temperature, magnetic_field, effective_mass, harmonic=1)

Calculate the Lifshitz-Kosevich damping factor for quantum oscillations.

Parameters:

Name Type Description Default
temperature float

Temperature in Kelvin.

required
magnetic_field float

Magnetic field in Tesla.

required
effective_mass float

Effective mass in units of the electron mass.

required
harmonic int

Harmonic number. Defaults to 1.

1

Returns:

Name Type Description
float

Amplitude of quantum oscillations.

Source code in src/quantalyze/quantum_oscillations.py
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
def lifshitz_kosevich_damping_factor(temperature: float, magnetic_field: float, effective_mass: float, harmonic: int = 1):
    """
    Calculate the Lifshitz-Kosevich damping factor for quantum oscillations.

    Args:
        temperature (float): Temperature in Kelvin.
        magnetic_field (float): Magnetic field in Tesla.
        effective_mass (float): Effective mass in units of the electron mass.
        harmonic (int, optional): Harmonic number. Defaults to 1.

    Returns:
        float: Amplitude of quantum oscillations.
    """
    cyclotron_mass = effective_mass * ELECTRON_MASS
    x = (2 * PI**2 * BOLTZMANN_CONSTANT * cyclotron_mass * temperature * harmonic) / (REDUCED_PLANCK_CONSTANT * ELEMENTARY_CHARGE * magnetic_field)
    amplitude = x / sinh(x)
    return amplitude

mean_inverse_field(minimum, maximum)

Calculate the mean inverse field from the minimum and maximum fields.

Parameters:

Name Type Description Default
minimum float

Minimum magnetic field in Tesla.

required
maximum float

Maximum magnetic field in Tesla.

required

Returns:

Name Type Description
float

Mean inverse field in Tesla^-1.

Source code in src/quantalyze/quantum_oscillations.py
104
105
106
107
108
109
110
111
112
113
114
115
def mean_inverse_field(minimum: float, maximum: float):
    """
    Calculate the mean inverse field from the minimum and maximum fields.

    Args:
        minimum (float): Minimum magnetic field in Tesla.
        maximum (float): Maximum magnetic field in Tesla.

    Returns:
        float: Mean inverse field in Tesla^-1.
    """
    return ((1 / minimum + 1 / maximum) / 2)