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. - Uses
spinfinity.dIdV3for third-order calculations if specified.
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, normalizes the resulting dI/dV spectrum by dividing by the first value. 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
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 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |
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 by the first conduction value. 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
|
differential conductance (dI/dV) spectrum. |
P |
ndarray of shape (dimensionOfMatrix, N)
|
Matrix of state populations for each voltage point. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If tip-tip scattering is enabled and G_ss[ReadoutSpin] is not positive. |
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
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 317 318 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 349 350 351 352 353 354 355 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 | |
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
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 | |
plot_IETS(spinsys, V_array=None, norm=False, order='2nd', plotAllSpins=False, show=None)
Plot the Inelastic Electron Tunneling Spectroscopy (IETS) spectrum.
Calculate and visualize an IETS spectrum using Plotly. Supports second- and third-order calculations with thermal populations or stationary rate equations.
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
|
Divide each spectrum by its first conductance value if True. Default is False. |
False
|
order
|
str
|
Calculation mode: '2nd', '2ndR', '3rd' or '3rdR'. Modes ending in 'R' use stationary rate equations. Default is '2nd'. |
'2nd'
|
plotAllSpins
|
bool
|
Calculate a spectrum for each readout spin if True. Default is False. |
False
|
show
|
(fixed, responsive, no)
|
Display mode. |
"fixed"
|
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
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 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 | |
tunnelingBroadenedStepFunction(x)
Compute the tunneling broadened step function.
This function calculates a broadened step function used in tunneling spectroscopy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
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
141 142 143 144 145 146 147 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 | |