Carbon Chain (Part 2)
This example demonstrates the calculations of charge current, spin torque, and interfacial spin current for a two-probe carbon chain. Unlike the first example, this device is subject to an electrical bias of 0.1 V.
Import Necessary Libraries
import matplotlib.pyplot as plt
import numpy as np
import junpy as jp
from junpy.factory import nanodcal
from junpy.experiment.extend_center_2 import extend_center
%config InlineBackend.figure_formats = ['svg']
%config InlineBackend.rc = {'font.size': 12}
Load Device
In order to observe the variation of the spin torque and interfacial spin current beyond the central region, we can include the electrode atoms into the central region using the extend_center function. repeatL and repeatR specify the repetition multiples of the left and right electrodes, respectively.
filename = (
'jpdataset/nanodcal/twoprobe_carbon_chain/'
'LDA_NC_dC-3.0-ang/sys_6C-vac5ang-6C_zx0-zx90/v0.10/NanodcalStructObject.mat')
device = nanodcal.load_nanodcal_device(filename)
device_ext = extend_center(device, repeatL=3, repeatR=3)
Calculate Charge Current
We first calculate the charge current using the Landau’s formula. jp.BiasWindow(interval=0.005) specifies that the energy integral is in the bias window and the interval is 0.005.
calcr = jp.Current(
device=device,
energies=jp.BiasWindow(interval=0.005),
etaSigma=1e-6,
etaGF=0)
jp.run(calcr, savefile=False)
Show code cell output
JunPy version---------------------------: 0.15.0.post29+ga5b3260
Parallelization information
BLAS Vendor-----------------------------: MKL
Total number of MPI processes-----------: 1
OMP_NUM_THREADS-------------------------: 1
MKL_NUM_THREADS-------------------------: unset
OPENBLAS_NUM_THREADS--------------------: unset
Calculating current... (2024-08-15 20:30:08)
Device information
bias (mu2-mu1)--------------------------: 0.10000001031619467
central.numberOfSites-------------------: 12
central.spinType------------------------: SpinType.GeneralSpin
lead1.numberOfSites---------------------: 3
lead1.spinType--------------------------: SpinType.GeneralSpin
lead1.direction-------------------------: -3
lead1.temperature-----------------------: 0.0
lead1.chemicalPotential-----------------: -0.0
lead2.numberOfSites---------------------: 3
lead2.spinType--------------------------: SpinType.GeneralSpin
lead2.direction-------------------------: -3
lead2.temperature-----------------------: 0.0
lead2.chemicalPotential-----------------: 0.10000001031619467
Energy sampling
samplingName----------------------------: CustomSampling
range-----------------------------------: [0.0000e+00, 1.0000e-01]
number----------------------------------: 21
K-space sampling
samplingName----------------------------: GammaKspaceSampling
numReducedKpoints-----------------------: 1
Runtime message
Integrate over energy and k-space...
Start MPI execution...
--> 9.5% finished (Elapsed time: 0:00:00.228234)
--> 14.3% finished (Elapsed time: 0:00:00.109371)
--> 19.0% finished (Elapsed time: 0:00:00.106565)
--> 23.8% finished (Elapsed time: 0:00:00.109306)
--> 28.6% finished (Elapsed time: 0:00:00.106735)
--> 33.3% finished (Elapsed time: 0:00:00.109937)
--> 38.1% finished (Elapsed time: 0:00:00.111408)
--> 42.9% finished (Elapsed time: 0:00:00.114061)
--> 47.6% finished (Elapsed time: 0:00:00.137588)
--> 52.4% finished (Elapsed time: 0:00:00.116131)
--> 57.1% finished (Elapsed time: 0:00:00.120204)
--> 61.9% finished (Elapsed time: 0:00:00.121313)
--> 66.7% finished (Elapsed time: 0:00:00.116271)
--> 71.4% finished (Elapsed time: 0:00:00.117937)
--> 76.2% finished (Elapsed time: 0:00:00.126648)
--> 81.0% finished (Elapsed time: 0:00:00.111192)
--> 85.7% finished (Elapsed time: 0:00:00.111798)
--> 90.5% finished (Elapsed time: 0:00:00.119536)
--> 95.2% finished (Elapsed time: 0:00:00.117534)
--> 100.0% finished (Elapsed time: 0:00:00.114353)
Wait for other processes...
--> finished (Elapsed time: 0:00:00.000057)
Gather results from other processes...
--> finished (Elapsed time: 0:00:00.000071)
Transmission report
Energy_eV T_up-up T_dn-dn T_Re-up-dn T_Im-up-dn
0.000000e+00 5.125604e-03 5.155845e-03 5.125587e-03 5.870280e-07
5.000000e-03 5.168260e-03 5.199103e-03 5.168243e-03 2.792357e-07
1.000000e-02 5.177481e-03 5.208924e-03 5.177463e-03 -4.197218e-08
1.500000e-02 5.153973e-03 5.186013e-03 5.153955e-03 -3.766792e-07
2.000000e-02 5.103020e-03 5.135655e-03 5.103002e-03 -7.248664e-07
2.500000e-02 5.033139e-03 5.066364e-03 5.033122e-03 -1.086472e-06
3.000000e-02 4.953992e-03 4.987802e-03 4.953974e-03 -1.461457e-06
3.500000e-02 4.874493e-03 4.908883e-03 4.874476e-03 -1.849847e-06
4.000000e-02 4.801748e-03 4.836712e-03 4.801731e-03 -2.251742e-06
4.500000e-02 4.740657e-03 4.776187e-03 4.740640e-03 -2.667317e-06
5.000000e-02 4.694354e-03 4.730444e-03 4.694337e-03 -3.096793e-06
5.500000e-02 4.664560e-03 4.701202e-03 4.664543e-03 -3.540424e-06
6.000000e-02 4.652075e-03 4.689260e-03 4.652058e-03 -3.998476e-06
6.500000e-02 4.657063e-03 4.694781e-03 4.657046e-03 -4.471221e-06
7.000000e-02 4.679121e-03 4.717362e-03 4.679104e-03 -4.958921e-06
7.500000e-02 4.717060e-03 4.755813e-03 4.717043e-03 -5.461822e-06
8.000000e-02 4.768320e-03 4.807572e-03 4.768303e-03 -5.980142e-06
8.500000e-02 4.827857e-03 4.867596e-03 4.827840e-03 -6.514042e-06
9.000000e-02 4.886376e-03 4.926586e-03 4.886358e-03 -7.063593e-06
9.500000e-02 4.927877e-03 4.968544e-03 4.927859e-03 -7.628725e-06
1.000000e-01 4.927375e-03 4.968483e-03 4.927357e-03 -8.209163e-06
Current report
Bias[V] I_tot[A] I_up[A] I_dn[A] I_s[A] I_sp[%]
1.000000e-01 3.791430e-08 1.888751e-08 1.902679e-08 -1.392818e-10 -3.673596e-01
Calculation of current finished (2024-08-15 20:30:11)
Elapsed time----------------------------: 0:00:02.463467
The [calcr].current function returns the calculated value.
current = calcr.current(spin="sum")
print(f'The charge current is {current} ampere.')
The charge current is [3.79142962e-08] ampere.
Calculate Spin Torque
We use the jp.SpinTorque class to build a calculation for spin torque. nonequilibriumEnergies specifies the energy sampling for integrating the real-axis energy for the Green’s function. equilibriumEnergies specifies the energy sampling for integrating the complex contour energy for the Green’s function. circlePoints is the number of points, and lowestEnergy is the starting point for the lowest energy. spinAccumulationDetail specifies whether to compute the spin accumulation or not.
calcr_st = jp.SpinTorque(
device=device_ext,
nonequilibriumEnergies=jp.BiasWindow(interval=0.005),
equilibriumEnergies=dict(
circlePoints=30,
lowestEnergy=-30),
spinAccumulationDetail=True)
jp.run(calcr_st, savefile=False)
Show code cell output
JunPy version---------------------------: 0.15.0.post29+ga5b3260
Parallelization information
BLAS Vendor-----------------------------: MKL
Total number of MPI processes-----------: 1
OMP_NUM_THREADS-------------------------: 1
MKL_NUM_THREADS-------------------------: unset
OPENBLAS_NUM_THREADS--------------------: unset
Calculating spin torque... (2024-08-15 20:30:17)
Device information
bias (mu2-mu1)--------------------------: 0.10000001031619467
central.numberOfSites-------------------: 30
central.spinType------------------------: SpinType.GeneralSpin
lead1.numberOfSites---------------------: 3
lead1.spinType--------------------------: SpinType.GeneralSpin
lead1.direction-------------------------: -3
lead1.temperature-----------------------: 0.0
lead1.chemicalPotential-----------------: -0.0
lead2.numberOfSites---------------------: 3
lead2.spinType--------------------------: SpinType.GeneralSpin
lead2.direction-------------------------: 3
lead2.temperature-----------------------: 0.0
lead2.chemicalPotential-----------------: 0.10000001031619467
Energy sampling (equilibrium)
samplingName----------------------------: SemiCircleContourEnergySampling
range-----------------------------------: [-3.0000e+01+7.3317e-02j, 4.9821e-02+7.3317e-02j]
number----------------------------------: 30
temperature-----------------------------: 0.0
chemicalPotential-----------------------: 0.050000005158097334
circlePoints----------------------------: 30
lowestEnergy----------------------------: -30
Energy sampling (non-equilibrium)
samplingName----------------------------: CustomSampling
range-----------------------------------: [0.0000e+00, 1.0000e-01]
number----------------------------------: 21
K-space sampling
samplingName----------------------------: GammaKspaceSampling
numReducedKpoints-----------------------: 1
Runtime message
Integrate over energy and k-space...
Start MPI execution...
--> 6.7% finished (Elapsed time: 0:00:03.509986)
--> 13.3% finished (Elapsed time: 0:00:03.485396)
--> 20.0% finished (Elapsed time: 0:00:03.381314)
--> 26.7% finished (Elapsed time: 0:00:03.340263)
--> 33.3% finished (Elapsed time: 0:00:03.272934)
--> 40.0% finished (Elapsed time: 0:00:03.311562)
--> 46.7% finished (Elapsed time: 0:00:03.324781)
--> 53.3% finished (Elapsed time: 0:00:03.312329)
--> 60.0% finished (Elapsed time: 0:00:03.297522)
--> 66.7% finished (Elapsed time: 0:00:03.231385)
--> 70.0% finished (Elapsed time: 0:00:01.634883)
--> 73.3% finished (Elapsed time: 0:00:01.609632)
--> 76.7% finished (Elapsed time: 0:00:01.619557)
--> 80.0% finished (Elapsed time: 0:00:01.621894)
--> 83.3% finished (Elapsed time: 0:00:01.684925)
--> 86.7% finished (Elapsed time: 0:00:01.621701)
--> 90.0% finished (Elapsed time: 0:00:01.623025)
--> 93.3% finished (Elapsed time: 0:00:01.670311)
--> 96.7% finished (Elapsed time: 0:00:01.610550)
--> 100.0% finished (Elapsed time: 0:00:01.606518)
Wait for other processes...
--> finished (Elapsed time: 0:00:00.000006)
Gather results from other processes...
--> finished (Elapsed time: 0:00:00.000104)
Integrate over energy and k-space...
Start MPI execution...
--> 9.5% finished (Elapsed time: 0:00:03.526256)
--> 14.3% finished (Elapsed time: 0:00:01.806523)
--> 19.0% finished (Elapsed time: 0:00:01.749344)
--> 23.8% finished (Elapsed time: 0:00:01.746309)
--> 28.6% finished (Elapsed time: 0:00:01.757293)
--> 33.3% finished (Elapsed time: 0:00:01.760958)
--> 38.1% finished (Elapsed time: 0:00:01.754006)
--> 42.9% finished (Elapsed time: 0:00:01.828860)
--> 47.6% finished (Elapsed time: 0:00:01.799265)
--> 52.4% finished (Elapsed time: 0:00:01.826866)
--> 57.1% finished (Elapsed time: 0:00:01.796251)
--> 61.9% finished (Elapsed time: 0:00:01.931762)
--> 66.7% finished (Elapsed time: 0:00:01.980609)
--> 71.4% finished (Elapsed time: 0:00:01.833493)
--> 76.2% finished (Elapsed time: 0:00:02.077866)
--> 81.0% finished (Elapsed time: 0:00:01.868748)
--> 85.7% finished (Elapsed time: 0:00:01.795185)
--> 90.5% finished (Elapsed time: 0:00:01.882095)
--> 95.2% finished (Elapsed time: 0:00:01.828351)
--> 100.0% finished (Elapsed time: 0:00:01.782389)
Wait for other processes...
--> finished (Elapsed time: 0:00:00.000021)
Gather results from other processes...
--> finished (Elapsed time: 0:00:00.000098)
Report of the spin accumulation (Hamiltonian = H)
Site Ax_eV Ay_eV Az_eV
0.000000e+00 2.391885e-10 -7.026460e-10 1.629750e-02
1.000000e+00 -2.836272e-09 -2.179475e-09 -1.671807e-02
2.000000e+00 4.118441e-09 9.829391e-09 4.697895e-04
3.000000e+00 1.159065e-08 6.948219e-09 2.901698e-05
4.000000e+00 -3.516658e-08 -7.322370e-08 -1.246392e-06
5.000000e+00 -3.264152e-08 1.540051e-08 -1.772569e-07
6.000000e+00 2.525382e-07 5.097357e-07 4.042458e-08
7.000000e+00 -9.355308e-08 -6.991133e-07 1.133889e-09
8.000000e+00 -1.694422e-06 -3.231379e-06 -1.555806e-09
9.000000e+00 2.215984e-06 6.009934e-06 3.682049e-10
1.000000e+01 5.445955e-06 1.254568e-05 -9.172095e-11
1.100000e+01 -8.368109e-06 -2.281097e-05 -2.218483e-10
1.200000e+01 -2.192596e-05 -5.769606e-05 -1.193909e-09
1.300000e+01 3.141844e-05 7.138241e-05 -4.728251e-09
1.400000e+01 6.940915e-05 1.611806e-04 -2.494360e-07
1.500000e+01 2.445917e-07 -1.560270e-04 -6.818500e-05
1.600000e+01 6.256708e-09 -7.588276e-05 -3.145995e-05
1.700000e+01 1.165871e-09 5.219711e-05 1.951402e-05
1.800000e+01 3.661119e-10 2.726874e-05 9.048806e-06
1.900000e+01 1.037239e-10 -1.131641e-05 -4.704706e-06
2.000000e+01 -7.983134e-10 -6.642211e-06 -2.171086e-06
2.100000e+01 2.470659e-09 2.656863e-06 1.306189e-06
2.200000e+01 3.708007e-09 1.125140e-06 2.496813e-07
2.300000e+01 -3.855253e-08 -5.336990e-07 -2.256748e-07
2.400000e+01 1.020493e-07 -6.952084e-08 -2.963345e-09
2.500000e+01 -1.795353e-06 8.784957e-08 3.642886e-08
2.600000e+01 3.277303e-05 -1.797359e-10 -3.976666e-09
2.700000e+01 4.139673e-04 -1.383013e-08 -5.682770e-09
2.800000e+01 -1.800594e-02 1.570455e-09 1.319261e-09
2.900000e+01 1.748407e-02 1.468057e-09 4.787378e-10
Report of the spin torque (Hamiltonian = Hxc)
Site Tx_eV Ty_eV Tz_eV
0.000000e+00 3.269584e-10 1.223634e-09 -1.324897e-55
1.000000e+00 2.785171e-09 2.166280e-09 -1.257245e-56
2.000000e+00 -4.123942e-09 -9.813811e-09 5.993176e-55
3.000000e+00 -1.159091e-08 -6.942518e-09 -7.645471e-56
4.000000e+00 3.516636e-08 7.322534e-08 -4.216161e-54
5.000000e+00 3.264148e-08 -1.539991e-08 3.151663e-54
6.000000e+00 -2.525382e-07 -5.097355e-07 3.949711e-53
7.000000e+00 9.355309e-08 6.991135e-07 -6.324194e-52
8.000000e+00 1.694423e-06 3.231379e-06 -9.014559e-13
9.000000e+00 -2.215984e-06 -6.009935e-06 1.441766e-11
1.000000e+01 -5.445954e-06 -1.254568e-05 2.673385e-11
1.100000e+01 8.368109e-06 2.281097e-05 2.245092e-10
1.200000e+01 2.192596e-05 5.769606e-05 1.195948e-09
1.300000e+01 -3.141844e-05 -7.138241e-05 4.727459e-09
1.400000e+01 -6.940915e-05 -1.611806e-04 2.494362e-07
1.500000e+01 -2.445916e-07 1.560270e-04 6.818500e-05
1.600000e+01 -6.255845e-09 7.588276e-05 3.145995e-05
1.700000e+01 -1.175754e-09 -5.219711e-05 -1.951402e-05
1.800000e+01 -3.346235e-10 -2.726874e-05 -9.048806e-06
1.900000e+01 -3.892913e-11 1.131641e-05 4.704706e-06
2.000000e+01 -1.767191e-11 6.642212e-06 2.171086e-06
2.100000e+01 9.832168e-13 -2.656864e-06 -1.306189e-06
2.200000e+01 -1.226281e-19 -1.125140e-06 -2.496813e-07
2.300000e+01 1.219638e-19 5.336987e-07 2.256747e-07
2.400000e+01 1.818635e-21 6.952008e-08 2.963127e-09
2.500000e+01 -1.892528e-20 -8.785165e-08 -3.642946e-08
2.600000e+01 2.226064e-21 1.724682e-10 3.974142e-09
2.700000e+01 2.499830e-21 1.380589e-08 5.675230e-09
2.800000e+01 -7.099308e-22 -1.569675e-09 -1.304434e-09
2.900000e+01 -4.567913e-22 -2.116465e-09 -8.689176e-10
Report of the spin torque (Hamiltonian = Hso)
Site Tx_eV Ty_eV Tz_eV
0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
1.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
2.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
3.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
4.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
5.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
6.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
7.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
8.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
9.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
1.000000e+01 0.000000e+00 0.000000e+00 0.000000e+00
1.100000e+01 0.000000e+00 0.000000e+00 0.000000e+00
1.200000e+01 0.000000e+00 0.000000e+00 0.000000e+00
1.300000e+01 0.000000e+00 0.000000e+00 0.000000e+00
1.400000e+01 0.000000e+00 0.000000e+00 0.000000e+00
1.500000e+01 0.000000e+00 0.000000e+00 0.000000e+00
1.600000e+01 0.000000e+00 0.000000e+00 0.000000e+00
1.700000e+01 0.000000e+00 0.000000e+00 0.000000e+00
1.800000e+01 0.000000e+00 0.000000e+00 0.000000e+00
1.900000e+01 0.000000e+00 0.000000e+00 0.000000e+00
2.000000e+01 0.000000e+00 0.000000e+00 0.000000e+00
2.100000e+01 0.000000e+00 0.000000e+00 0.000000e+00
2.200000e+01 0.000000e+00 0.000000e+00 0.000000e+00
2.300000e+01 0.000000e+00 0.000000e+00 0.000000e+00
2.400000e+01 0.000000e+00 0.000000e+00 0.000000e+00
2.500000e+01 0.000000e+00 0.000000e+00 0.000000e+00
2.600000e+01 0.000000e+00 0.000000e+00 0.000000e+00
2.700000e+01 0.000000e+00 0.000000e+00 0.000000e+00
2.800000e+01 0.000000e+00 0.000000e+00 0.000000e+00
2.900000e+01 0.000000e+00 0.000000e+00 0.000000e+00
Calculation of spin torque finished (2024-08-15 20:31:46)
Elapsed time----------------------------: 0:01:28.597522
In this example, we have 30 atoms in the extended central region. We create an array sites to label them:
sites = np.arange(0, 30)
The [calcr].spin_torque function returns the computed spin torque values. The hamiltonian parameter specifies the Hamiltonian used for computing the spin torque. Possible values are 'full' (default), 'H0', 'Hxc', and 'Hso'. Note that 'Hxc' and 'Hso' correspond to the exchange spin torque ($T^\mathrm{XC}$) and spin-orbit torque ($T^\mathrm{SO}$), respectively.
# shape: (#kpoints, #energies, #sites, #spin)
st = calcr_st.spin_torque(hamiltonian='Hxc')
# shape: (#sites, #spin)
st = st[0,0]
We exclude the boundary atoms using [3:-3] to remove the uncalculated boundary results:
plt.plot(sites[3:-3], st[3:-3,0]*1e3, '.-', label='Txc_x')
plt.plot(sites[3:-3], st[3:-3,1]*1e3, '.-', label='Txc_y')
plt.plot(sites[3:-3], st[3:-3,2]*1e3, '.-', label='Txc_z')
plt.xlabel('Site (#)')
plt.ylabel('Spin torque (meV)')
plt.legend()
plt.show()
The [calcr].spin_accumulation function is used to retrieve the computed spin accumulation values ($\Phi$).
# shape: (#kpoints, #energies, #sites, #spin)
sa = calcr_st.spin_accumulation()
# shape: (#sites, #spin)
sa = sa[0,0]
plt.plot(sites[3:-3], sa[3:-3,0]*1e3, '.-', label='$\Phi$x')
plt.plot(sites[3:-3], sa[3:-3,1]*1e3, '.-', label='$\Phi$y')
plt.plot(sites[3:-3], sa[3:-3,2]*1e3, '.-', label='$\Phi$z')
plt.xlabel('Site (#)')
plt.ylabel('Spin accumulation (meV)')
plt.legend()
plt.show()
Calculate Interfacial Spin Current
For comparison, we also compute the interfacial spin current using the jp.SpinCurrent class.
calcr_sc = jp.SpinCurrent(
device=device_ext,
nonequilibriumEnergies=jp.BiasWindow(interval=0.005),
equilibriumEnergies=dict(
circlePoints=30,
lowestEnergy=-30))
jp.run(calcr_sc, savefile=False)
Show code cell output
JunPy version---------------------------: 0.15.0.post29+ga5b3260
Parallelization information
BLAS Vendor-----------------------------: MKL
Total number of MPI processes-----------: 1
OMP_NUM_THREADS-------------------------: 1
MKL_NUM_THREADS-------------------------: unset
OPENBLAS_NUM_THREADS--------------------: unset
Calculating spin current... (2024-08-15 20:38:09)
Device information
bias (mu2-mu1)--------------------------: 0.10000001031619467
central.numberOfSites-------------------: 30
central.spinType------------------------: SpinType.GeneralSpin
lead1.numberOfSites---------------------: 3
lead1.spinType--------------------------: SpinType.GeneralSpin
lead1.direction-------------------------: -3
lead1.temperature-----------------------: 0.0
lead1.chemicalPotential-----------------: -0.0
lead2.numberOfSites---------------------: 3
lead2.spinType--------------------------: SpinType.GeneralSpin
lead2.direction-------------------------: 3
lead2.temperature-----------------------: 0.0
lead2.chemicalPotential-----------------: 0.10000001031619467
Energy sampling (equilibrium)
samplingName----------------------------: SemiCircleContourEnergySampling
range-----------------------------------: [-3.0000e+01+7.3317e-02j, 4.9821e-02+7.3317e-02j]
number----------------------------------: 30
temperature-----------------------------: 0.0
chemicalPotential-----------------------: 0.050000005158097334
circlePoints----------------------------: 30
lowestEnergy----------------------------: -30
Energy sampling (non-equilibrium)
samplingName----------------------------: CustomSampling
range-----------------------------------: [0.0000e+00, 1.0000e-01]
number----------------------------------: 21
K-space sampling
samplingName----------------------------: GammaKspaceSampling
numReducedKpoints-----------------------: 1
Runtime message
Integrate over energy and k-space...
Start MPI execution...
--> 6.7% finished (Elapsed time: 0:00:01.713761)
--> 13.3% finished (Elapsed time: 0:00:01.681413)
--> 20.0% finished (Elapsed time: 0:00:01.666176)
--> 26.7% finished (Elapsed time: 0:00:01.703826)
--> 33.3% finished (Elapsed time: 0:00:01.640098)
--> 40.0% finished (Elapsed time: 0:00:01.701506)
--> 46.7% finished (Elapsed time: 0:00:01.668116)
--> 53.3% finished (Elapsed time: 0:00:01.661861)
--> 60.0% finished (Elapsed time: 0:00:01.669353)
--> 66.7% finished (Elapsed time: 0:00:01.700550)
--> 70.0% finished (Elapsed time: 0:00:00.787154)
--> 73.3% finished (Elapsed time: 0:00:00.786871)
--> 76.7% finished (Elapsed time: 0:00:00.775879)
--> 80.0% finished (Elapsed time: 0:00:00.811188)
--> 83.3% finished (Elapsed time: 0:00:00.822507)
--> 86.7% finished (Elapsed time: 0:00:00.823056)
--> 90.0% finished (Elapsed time: 0:00:00.829303)
--> 93.3% finished (Elapsed time: 0:00:00.829970)
--> 96.7% finished (Elapsed time: 0:00:00.836421)
--> 100.0% finished (Elapsed time: 0:00:00.872034)
Wait for other processes...
--> finished (Elapsed time: 0:00:00.000024)
Gather results from other processes...
--> finished (Elapsed time: 0:00:00.007837)
Integrate over energy and k-space...
Start MPI execution...
--> 9.5% finished (Elapsed time: 0:00:01.974358)
--> 14.3% finished (Elapsed time: 0:00:00.994233)
--> 19.0% finished (Elapsed time: 0:00:00.979632)
--> 23.8% finished (Elapsed time: 0:00:00.976806)
--> 28.6% finished (Elapsed time: 0:00:00.980045)
--> 33.3% finished (Elapsed time: 0:00:00.990213)
--> 38.1% finished (Elapsed time: 0:00:00.980436)
--> 42.9% finished (Elapsed time: 0:00:00.976911)
--> 47.6% finished (Elapsed time: 0:00:00.979780)
--> 52.4% finished (Elapsed time: 0:00:00.979087)
--> 57.1% finished (Elapsed time: 0:00:00.976780)
--> 61.9% finished (Elapsed time: 0:00:01.039201)
--> 66.7% finished (Elapsed time: 0:00:00.977404)
--> 71.4% finished (Elapsed time: 0:00:00.977939)
--> 76.2% finished (Elapsed time: 0:00:00.978536)
--> 81.0% finished (Elapsed time: 0:00:00.986795)
--> 85.7% finished (Elapsed time: 0:00:00.974766)
--> 90.5% finished (Elapsed time: 0:00:00.987233)
--> 95.2% finished (Elapsed time: 0:00:00.979331)
--> 100.0% finished (Elapsed time: 0:00:00.979152)
Wait for other processes...
--> finished (Elapsed time: 0:00:00.000012)
Gather results from other processes...
--> finished (Elapsed time: 0:00:00.009382)
Report of the intra-atomic spin current accumulation
Site A0_intra_eV Ax_intra_eV Ay_intra_eV Az_intra_eV
0.000000e+00 9.497611e-17 -1.439967e-27 -4.761170e-26 1.517883e-17
1.000000e+00 -1.439532e-18 6.602011e-26 6.019083e-26 7.951522e-20
2.000000e+00 -1.047351e-19 -9.094378e-26 -9.527625e-26 -1.004776e-20
3.000000e+00 1.001354e-21 4.256611e-26 1.862764e-26 1.414944e-21
4.000000e+00 -6.349936e-22 7.181482e-25 -6.966878e-25 7.961581e-22
5.000000e+00 8.885729e-26 1.253659e-25 4.422670e-25 -2.430610e-23
6.000000e+00 2.895082e-24 -2.007251e-24 7.347041e-24 2.056567e-24
7.000000e+00 1.428565e-24 1.306155e-24 -1.526988e-24 -2.773661e-24
8.000000e+00 -1.690550e-23 3.034477e-23 5.394769e-23 5.557620e-24
9.000000e+00 1.137373e-24 8.575940e-24 7.837859e-23 -8.065011e-24
1.000000e+01 2.773640e-23 1.062410e-22 -1.556909e-22 4.213451e-24
1.100000e+01 -2.982051e-23 -8.116710e-24 -2.998530e-24 -3.317124e-23
1.200000e+01 -1.257315e-22 -4.113156e-22 1.100977e-21 1.406207e-22
1.300000e+01 -1.819797e-21 -5.012715e-22 7.385069e-21 -1.058791e-22
1.400000e+01 3.388132e-21 -4.870439e-21 2.541099e-21 -3.811648e-21
1.500000e+01 -3.176374e-21 -3.176374e-21 2.541109e-21 5.717472e-21
1.600000e+01 -8.007108e-22 9.264423e-23 6.220462e-22 -1.968690e-22
1.700000e+01 -1.159707e-21 1.579915e-22 1.049696e-21 9.802090e-22
1.800000e+01 -2.305766e-23 2.838263e-23 3.207374e-22 1.000372e-23
1.900000e+01 -5.893662e-24 5.014782e-24 1.912843e-22 -1.487633e-23
2.000000e+01 -8.375204e-24 9.822770e-24 2.613797e-23 -2.985605e-23
2.100000e+01 2.347125e-23 1.386820e-23 -2.245020e-23 -1.368725e-23
2.200000e+01 -3.709250e-25 -8.239982e-25 5.641294e-25 -1.129269e-23
2.300000e+01 -2.448624e-25 1.672612e-24 -4.979871e-24 -2.134205e-24
2.400000e+01 8.229801e-24 8.211222e-25 2.421712e-24 -5.315009e-26
2.500000e+01 2.583001e-23 3.915149e-22 1.730736e-24 7.056834e-25
2.600000e+01 2.568913e-21 8.360211e-22 1.327838e-26 -2.261822e-26
2.700000e+01 1.766072e-20 -1.159577e-19 -1.714033e-25 1.033319e-33
2.800000e+01 -1.074885e-18 5.283368e-20 4.623434e-26 -9.309110e-34
2.900000e+01 -8.326673e-17 -2.818926e-18 -1.234095e-26 -5.617810e-33
Report of the inter-atomic spin current accumulation
Site A0_inter_eV Ax_inter_eV Ay_inter_eV Az_inter_eV
0.000000e+00 3.309805e-02 2.391885e-10 -7.026460e-10 1.629750e-02
1.000000e+00 -3.299830e-02 -2.836272e-09 -2.179475e-09 -1.671807e-02
2.000000e+00 -3.247305e-05 4.118441e-09 9.829391e-09 4.697895e-04
3.000000e+00 1.166710e-05 1.159065e-08 6.948219e-09 2.901698e-05
4.000000e+00 -1.915138e-06 -3.516658e-08 -7.322370e-08 -1.246392e-06
5.000000e+00 -2.031594e-07 -3.264152e-08 1.540051e-08 -1.772569e-07
6.000000e+00 3.946354e-08 2.525382e-07 5.097357e-07 4.042459e-08
7.000000e+00 1.102399e-09 -9.355308e-08 -6.991133e-07 1.133891e-09
8.000000e+00 -1.557392e-09 -1.694422e-06 -3.231379e-06 -1.555806e-09
9.000000e+00 3.826318e-10 2.215984e-06 6.009934e-06 3.682017e-10
1.000000e+01 -6.498934e-11 5.445955e-06 1.254568e-05 -9.172633e-11
1.100000e+01 2.660680e-12 -8.368109e-06 -2.281097e-05 -2.218487e-10
1.200000e+01 2.040275e-12 -2.192596e-05 -5.769606e-05 -1.193908e-09
1.300000e+01 -7.924081e-13 3.141844e-05 7.138241e-05 -4.728251e-09
1.400000e+01 1.665564e-13 6.940915e-05 1.611806e-04 -2.494360e-07
1.500000e+01 2.178072e-14 2.445917e-07 -1.560270e-04 -6.818500e-05
1.600000e+01 8.634398e-13 6.256708e-09 -7.588276e-05 -3.145995e-05
1.700000e+01 -9.883084e-12 1.165871e-09 5.219711e-05 1.951402e-05
1.800000e+01 3.148942e-11 3.661123e-10 2.726874e-05 9.048806e-06
1.900000e+01 6.480213e-11 1.037237e-10 -1.131641e-05 -4.704706e-06
2.000000e+01 -8.159100e-10 -7.983134e-10 -6.642211e-06 -2.171086e-06
2.100000e+01 2.471897e-09 2.470660e-09 2.656863e-06 1.306189e-06
2.200000e+01 3.692503e-09 3.708007e-09 1.125140e-06 2.496813e-07
2.300000e+01 -3.921867e-08 -3.855253e-08 -5.336990e-07 -2.256748e-07
2.400000e+01 8.183146e-08 1.020493e-07 -6.952084e-08 -2.963342e-09
2.500000e+01 -2.351105e-06 -1.795353e-06 8.784957e-08 3.642885e-08
2.600000e+01 1.777699e-05 3.277303e-05 -1.797358e-10 -3.976661e-09
2.700000e+01 -3.198684e-05 4.139673e-04 -1.383013e-08 -5.682770e-09
2.800000e+01 -3.261158e-02 -1.800594e-02 1.570455e-09 1.319258e-09
2.900000e+01 3.255123e-02 1.748407e-02 1.468057e-09 4.787358e-10
Calculation of spin current finished (2024-08-15 20:38:55)
Elapsed time----------------------------: 0:00:45.843087
Given that the central region consists of 30 atoms aligned along the $z$ axis, there are 29 interfaces. The [calcr].interfacial_spin_current function returns the electron current in units of eV. The spin currents, Qx, Qy, and Qz, correspond to the projections onto the Pauli matrices $\sigma_x$, $\sigma_y$, and $\sigma_z$, respectively. Q0 represents the total current, obtained by summing the spin-up and spin-down components, which is equivalent to projecting onto $\sigma_0$.
# #interfaces = #sites - 1
interfaces = np.arange(0, 29)
# shape: (#interfaces, #spin)
isc = calcr_sc.interfacial_spin_current()
plt.plot(interfaces[3:-3], isc[3:-3,1]*1e3, '.-', label='Qx')
plt.plot(interfaces[3:-3], isc[3:-3,2]*1e3, '.-', label='Qy')
plt.plot(interfaces[3:-3], isc[3:-3,3]*1e3, '.-', label='Qz')
plt.plot(interfaces[3:-3], isc[3:-3,0]*1e3, '.-', label='Q0')
plt.xlabel('Interface (#)')
plt.ylabel('Interfacial spin current (meV)')
plt.legend()
plt.show()
We also convert the electron current to the charge current in units of amperes by multiplying by $-2e/\hbar$. Note that the almost constant value of charge (I0=3.74e-8) is close to the value calculated by jp.Current.
isc2 = isc*(-1*jp.util.E2OVERHBAR)
plt.plot(interfaces[3:-3], isc2[3:-3,1], '.-', label='Ix')
plt.plot(interfaces[3:-3], isc2[3:-3,2], '.-', label='Iy')
plt.plot(interfaces[3:-3], isc2[3:-3,3], '.-', label='Iz')
plt.plot(interfaces[3:-3], isc2[3:-3,0], '.-', label='I0')
plt.xlabel('Interface (#)')
plt.ylabel('Interfacial spin current (A)')
plt.legend()
plt.show()
The gradient of the interfacial spin current should yield the results of spin accumulation. One can compare with the results from the [calcr].spin_accumulation calculation above.
# shape: (#sites-2, #spin)
isca = -np.diff(isc, axis=0)
plt.plot(sites[3:-3], isca[2:-2, 1]*1e3, '.-', label=r'-$\nabla$Qx')
plt.plot(sites[3:-3], isca[2:-2, 2]*1e3, '.-', label=r'-$\nabla$Qy')
plt.plot(sites[3:-3], isca[2:-2, 3]*1e3, '.-', label=r'-$\nabla$Qz')
plt.plot(sites[3:-3], isca[2:-2, 0]*1e3, '.-', label=r'-$\nabla$Q0')
plt.xlabel('Site (#)')
plt.ylabel('Spin current accumulation (meV)')
plt.legend()
plt.show()