Transport
transport
This module contains functions for calculating transport properties such as resistance, resistivity, and Hall resistance. Functions act on pandas DataFrames and return Series that can be assigned to new columns in the DataFrame.
calculate_hall_resistance(df, hall_voltage, current, gain=None)
Calculate the Hall resistance using the Hall voltage and current.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
df
|
DataFrame
|
The dataframe containing the data. |
required |
hall_voltage
|
str
|
The name of the column in the dataframe that contains the Hall voltage values. |
required |
current
|
str or float
|
The name of the column in the dataframe that contains the current values if it's a string, or a constant current value if it's a float. |
required |
gain
|
str or float
|
The name of the column in the dataframe that contains the gain values if it's a string, or a constant gain value if it's a float. Defaults to None. |
None
|
Returns:
| Type | Description |
|---|---|
Series
|
pandas.Series: A series containing the calculated Hall resistance values. |
Examples:
>>> import quantalize as qz
>>> df['hall_resistance'] = qz.calculate_hall_resistance(
>>> df,
>>> hall_voltage='hall_voltage_col',
>>> current='current_col',
>>> gain='gain_col'
>>> )
Source code in src/quantalyze/transport.py
110 111 112 113 114 115 116 117 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 | |
calculate_hall_resistivity(df, hall_resistance=None, hall_voltage=None, current=None, thickness=None, gain=None)
Calculate the Hall resistivity using either Hall resistance or Hall voltage and current, along with thickness.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
df
|
DataFrame
|
The dataframe containing the data. |
required |
hall_resistance
|
str
|
The name of the column in the dataframe that contains the Hall resistance values. |
None
|
hall_voltage
|
str
|
The name of the column in the dataframe that contains the Hall voltage values. |
None
|
current
|
str or float
|
The name of the column in the dataframe that contains the current values if it's a string, or a constant current value if it's a float. |
None
|
thickness
|
float
|
The thickness of the material. |
None
|
gain
|
str or float
|
The name of the column in the dataframe that contains the gain values if it's a string, or a constant gain value if it's a float. Defaults to None. |
None
|
Returns:
| Type | Description |
|---|---|
Series
|
pandas.Series: A series containing the calculated Hall resistivity values. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If neither hall_resistance nor both hall_voltage and current are provided. |
ValueError
|
If both hall_resistance and hall_voltage are provided. |
ValueError
|
If thickness is not provided. |
ValueError
|
If hall_resistance is supplied along with a gain. |
Examples:
>>> import quantalize as qz
>>> df['hall_resistivity'] = qz.calculate_hall_resistivity(
>>> df,
>>> hall_resistance='hall_resistance_col',
>>> hall_voltage='hall_voltage_col',
>>> current='current_col',
>>> thickness=11e-6,
>>> gain='gain_col'
>>> )
Source code in src/quantalyze/transport.py
148 149 150 151 152 153 154 155 156 157 158 159 160 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 | |
calculate_resistance(df, voltage, current, gain=None)
Calculate the electrical resistance using voltage and current.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
df
|
DataFrame
|
The dataframe containing the data. |
required |
voltage
|
str
|
The name of the column in the dataframe that contains the voltage values. |
required |
current
|
str or float
|
The name of the column in the dataframe that contains the current values if it's a string, or a constant current value if it's a float. |
required |
gain
|
str or float
|
The name of the column in the dataframe that contains the gain values if it's a string, or a constant gain value if it's a float. Defaults to None. |
None
|
Returns:
| Type | Description |
|---|---|
Series
|
pandas.Series: A series containing the calculated resistance values. |
Examples:
>>> import quantalize as qz
>>> df['resistance'] = qz.calculate_resistance(
>>> df,
>>> voltage='voltage_col',
>>> current='current_col',
>>> gain='gain_col'
>>> )
Source code in src/quantalyze/transport.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | |
calculate_resistivity(df, length=None, width=None, thickness=None, resistance=None, voltage=None, current=None, geometric_factor=None, gain=None)
Calculate the electrical resistivity using either resistance or voltage and current, along with length, width, and thickness, or a provided geometric factor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
df
|
DataFrame
|
The dataframe containing the data. |
required |
resistance
|
str
|
The name of the column in the dataframe that contains the resistance values. |
None
|
voltage
|
str
|
The name of the column in the dataframe that contains the voltage values. |
None
|
current
|
str or float
|
The name of the column in the dataframe that contains the current values if it's a string, or a constant current value if it's a float. |
None
|
length
|
float
|
The length of the material. |
None
|
width
|
float
|
The width of the material. |
None
|
thickness
|
float
|
The thickness of the material. |
None
|
geometric_factor
|
float
|
The pre-calculated geometric factor (width * thickness / length). |
None
|
gain
|
str or float
|
The name of the column in the dataframe that contains the gain values if it's a string, or a constant gain value if it's a float. Defaults to None. |
None
|
Returns:
| Type | Description |
|---|---|
Series
|
pandas.Series: A series containing the calculated resistivity values. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If neither resistance nor both voltage and current are provided. |
ValueError
|
If both resistance and voltage are provided. |
ValueError
|
If neither geometric_factor nor all of length, width, and thickness are provided. |
ValueError
|
If resistance is supplied along with a gain. |
Examples:
>>> import quantalize as qz
>>> df['resistivity'] = qz.calculate_resistivity(
>>> df,
>>> resistance='resistance_col',
>>> voltage='voltage_col',
>>> current='current_col',
>>> length=100e-6,
>>> width=300e-6,
>>> thickness=11e-6
>>> )
Source code in src/quantalyze/transport.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | |