dIdV
dIdV
Calculating and visualizing differential conductence (dI/dV) spectra.
This module provides routines to compute differential conductance spectra using second-order perturbation theory.
Functions:
| Name | Description |
|---|---|
calc_IETS_2nd |
Compute dI/dV using a second-order tunneling model and thermally populated states. |
tunnelingBroadenedStepFunction |
Compute the tunneling broadened step function used in the IETS calculations. |
calc_IETS_2ndR |
Compute dI/dV using a second-order tunneling model with voltage-dependent rate equations. |
calc_derivative |
Numerically differentiate current with respect to voltage. |
plot_IETS |
Plot IETS spectra for one or all spins using Plotly. |
Dependencies
- Uses
spinfinity.SpinSys.SpinSysclass to represent the spin system and its properties. - Uses
spinfinity.SpinHamiltonianfor eigenvalue and eigenvector calculations. - Uses functions from
spinfinity.Bathfor population and rate calculations.
References
- Ternes, M., Spin excitations and correlations in scanning tunneling spectroscopy. New J. Phys. 17, 063016 (2015). https://dx.doi.org/10.1088/1367-2630/17/6/063016
- Loth, S., von Bergmann, K., Ternes, M. et al. Controlling the state of quantum spins with electric currents. Nature Phys 6, 340–344 (2010). https://doi.org/10.1038/nphys1616
calc_IETS_2nd(spinsys, V_array=None, norm=False)
Calculate the derivative of the tunneling current (dI/dV) in 2nd Order.
This functions calculates the dI/dV signal as a function of voltage using a second-order tunneling model with thermally populated states.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
spinsys
|
SpinSys
|
The spin system object containing eigenvalues, eigenvectors, temperature, and other relevant parameters. |
required |
V_array
|
ndarray
|
An array of voltage values (in mV) at which to calculate dI/dV. If None, a default range from -30 mV to 30 mV with 200 points will be used. |
None
|
norm
|
bool
|
If True, normalize the output dI/dV array to the range [0, 1]. Default is False. |
False
|
Returns:
| Name | Type | Description |
|---|---|---|
V_array |
ndarray
|
Array of voltage values over the specified range. |
dIdV_array |
ndarray
|
Calculated dI/dV values corresponding to each voltage in V_array. |
Source code in spinfinity/dIdV.py
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 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 | |
calc_IETS_2ndR(spinsys, V_array=None, AllowPumping=True, norm=True)
Calculate the IETS spectrum using the rate equation approach.
This function calculates the dI/dV spectrum as a function of voltage using a second-order tunneling model combined with voltage-dependent rate equations that redistribute the spin state populations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
spinsys
|
SpinSys
|
The spin system object containing all relevant parameters and matrices. |
required |
V_array
|
ndarray
|
An array of voltage values (in mV) at which to calculate dI/dV. If None, a default range from -30 mV to 30 mV with 200 points will be used. |
None
|
AllowPumping
|
bool
|
If True, allows for non-thermal population of spin states (pumping). If False, uses thermal (Boltzmann) population. Default is True. |
True
|
norm
|
bool
|
If True, normalizes the resulting dI/dV spectrum to the range [0, 1]. Default is True. |
True
|
Returns:
| Name | Type | Description |
|---|---|---|
V_array |
ndarray
|
Array of voltage values (in mV) at which the spectrum is calculated. |
dIdV |
ndarray
|
The normalized differential conductance (dI/dV) spectrum. |
P |
ndarray of shape (dimensionOfMatrix, N)
|
Matrix of state populations for each voltage point. |
Notes
The calculation is based on the rate equation approach and supports both thermal
and non-thermal population distributions. For AllowPumping=False the function
should output the same result as calc_IETS_2nd.
The function updates the following attributes of spinsys:
spinsys.pop_0: The thermal population distribution (Boltzmann distribution) for the spin states.spinsys.MatrixST: The tunneling matrix elements for tip-sample scattering.spinsys.MatrixTS: The tunneling matrix elements for sample-tip scattering.spinsys.MatrixSS: The tunneling matrix elements for sample-sample scattering.spinsys.MatrixTT: The tunneling matrix elements for tip-tip scattering.
Source code in spinfinity/dIdV.py
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 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 | |
calc_derivative(Current, Voltage)
Calculate the numerical derivative dI/dV of current (I) with respect to voltage (V).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
Current
|
array_like
|
Array of current values. |
required |
Voltage
|
array_like
|
Array of voltage values. Must be the same length as |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dIdV |
ndarray
|
Array of numerical derivatives dI/dV, same length as input arrays. |
Source code in spinfinity/dIdV.py
319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 | |
plot_IETS(spinsys, V_array=None, norm=False, order='2nd', plotAllSpins=False)
Plot the Inelastic Electron Tunneling Spectroscopy (IETS) spectrum.
The function calculates the IETS spectrum for the given spin system and visualizes it using Plotly. It supports both 2nd order and 2nd order with rate equations calculations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
spinsys
|
SpinSys
|
The spin system object for which the IETS spectrum is to be calculated. |
required |
V_array
|
ndarray
|
An array of voltage values (in mV) at which to calculate the spectrum. If None, a default range from -30 mV to 30 mV with 200 points will be used. |
None
|
norm
|
bool
|
If True, normalize the calculated spectrum (default is False). |
False
|
order
|
str
|
The order of the IETS calculation. Supported orders are '2nd' and '2ndR'. |
'2nd'
|
Returns:
| Name | Type | Description |
|---|---|---|
return_dict |
dict
|
A dictionary containing: - 'fig': plotly.graph_objects.Figure The plotly figure object containing the plot. - 'V_array': numpy.ndarray The voltage values used in the spectrum. - 'dIdVsignal': numpy.ndarray The calculated dI/dV signal values. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If an unsupported order is specified. |
Notes
- the dimension of the dIdVsignal changes when plotAllSpins=True
Source code in spinfinity/dIdV.py
356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 | |
tunnelingBroadenedStepFunction(x_V)
Compute the tunneling broadened step function.
This function calculates a broadened step function used in tunneling spectroscopy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x_V
|
array_like or float
|
Input value(s) at which to evaluate the broadened step function. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
y |
ndarray or float
|
The value(s) of the tunneling broadened step function at |
Source code in spinfinity/dIdV.py
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | |