Author Topic: how do we calculate spin transport in finite bias?  (Read 7151 times)

0 Members and 1 Guest are viewing this topic.

Offline wot19920302

  • QuantumATK Guru
  • ****
  • Posts: 124
  • Country: cn
  • Reputation: 0
    • View Profile
how do we calculate spin transport in finite bias?
« on: March 16, 2017, 08:24 »
Dear Quantumstaffs:         I read a post from this link: http://quantumwise.com/forum/index.php?topic=4089.msg18685#msg18685 and two tutorials from these two links: http://docs.quantumwise.com/tutorials/fe_mgo_fe/fe_mgo_fe.html  and  http://docs.quantumwise.com/tutorials/transmission_atomic_chain/transmission_atomic_chain.html.  I notice that tutorials always use "old calculation" i.e. convergenced parallel configuration as initial state to calculate antiparallel   configuration. But how do we calculate spin transport of antiparallel  configuration in finite bias? I have some methods.        method 1.  firstly, we should calculate parallel configuration under 0 bias, get convergenced  parallel-0V.nc file, then read parallel-0V.nc as initial state,  set opposite spin distributed in two electrodes and calculate it, getting antiparallel-0v.nc file. finally, read antiparallel-0v.nc as inital state, apply finite bias, e.g. 0.2, 0.4, 0.8..1.2V and get .nc file under different bias(no initial-spin set again when calculate .nc file under finite bias ).        method 2.  firstly, we should calculate parallel configuration under 0 bias, get convergenced  parallel-0V.nc file. secondly, go on calculating parallel configuration under finite bias, get parallel-0.2V.nc,  parallel-0.4V.nc,  parallel-0.6V.nc and so on.  then use parallel-0V.nc tocalculate antiparallel-0V.nc,  use parallel-0.2V.nc to calculate antiparallel-0.2V.n,  use parallel-0.4V.nc to calculate antiparallel-0.4V.nc...get antiparallel .nc under different bias.        method 3.  No .nc file, create configuration and set opposite initial-spin in two eletrodes directly. get antiparallel-0V.nc, and then apply finite bias, get .nc file under diferent bias.        what's more, should we set initial-spin again when calculating transport under finite bias?        one script is :      
Code
 # -------------------------------------------------------------
# Initial State
# -------------------------------------------------------------
initial_spin = InitialSpin(scaled_spins=[0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0])
for bias in numpy.arange(0.0,1.2,0.2)*Volt:
	device_configuration.setCalculator(
	    calculator(electrode_voltages=(0.5*bias,-0.5*bias)),
	    initial_spin=initial_spin,
	)
	device_configuration.update()
	nlsave('%.1f.nc' % bias.inUnitsOf(Volt), device_configuration)
	nlprint(device_configuration)
another is
Code
device_configuration = nlread('0.0.nc', object_id='gID000')[0] 
device_configuration.setCalculator(calculator)
biases = [0.2, 0.4, 0.6, 0.8, 1.0, 1.2]*Volt 


for bias in biases:
    calculator=calculator(
            electrode_voltages=(bias/2, -bias/2))

    device_configuration.setCalculator(
            calculator(),
            initial_state=device_configuration
            )
    device_configuration.update()
    nlsave('%.1f.nc' % bias.inUnitsOf(Volt), device_configuration)
    in second script, 0.0.nc file is convergenced file under 0 bias     Best

Offline zh

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 1141
  • Reputation: 24
    • View Profile
Re: how do we calculate spin transport in finite bias?
« Reply #1 on: March 16, 2017, 09:53 »
These three ways mentioned in your post mean just the different starting points (in particular, the charge density) for the anti-parallel spin configurations at finite bias. The different starting points may affect the convergence speed (e.g., the computation time).  In principles, all of them should give a nearly same result for a given finite bias, the little difference may appear because of the numerical noise. The most safe way for the convergence problem is the third one. 

Offline wot19920302

  • QuantumATK Guru
  • ****
  • Posts: 124
  • Country: cn
  • Reputation: 0
    • View Profile
Re: how do we calculate spin transport in finite bias?
« Reply #2 on: March 16, 2017, 18:09 »
    thanks, Mr zh.  :D    what about another quesition? If I create a configuration and set 1 and -1 for right and left electrodes,respectivly. How do we calculate spin transport under finite bias? code one I give above seems to need set initial-spin again in every scf loop. And code two just set inital-spin under 0v, then read configurationfrom 0v.nc as  inital-state and apply bias(no inital spin setting under finite bias). Which code would be better?
    best

Offline zh

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 1141
  • Reputation: 24
    • View Profile
Re: how do we calculate spin transport in finite bias?
« Reply #3 on: March 17, 2017, 01:51 »
"what's more, should we set initial-spin again when calculating transport under finite bias?"
Sure, you should set the initial spin again in the calculation of finite bias.

The code one is preferable.

Offline wot19920302

  • QuantumATK Guru
  • ****
  • Posts: 124
  • Country: cn
  • Reputation: 0
    • View Profile
Re: how do we calculate spin transport in finite bias?
« Reply #4 on: March 17, 2017, 08:26 »
     sir, it seems that code one calculates configuration under finite bias directly from unconvergenced configuration. that's say we will get ap-0.2v.nc, ap-0.4.nc, ap-0.6.nc .....directly from unconvergenced configuration,i.e.    
Code
device_configuration = DeviceConfiguration(
    central_region,
    [left_electrode, right_electrode]
    )
.     For some simply systems, it may be ok, however, for some more complex systems, it would be very hard to get convergenced configuration under high bias without setting convergenced configuration as inital state. Combining with tutorials above, I think the code may be better like is:    
Code
 for bias in numpy.arange(0.0,1.2,0.2)*Volt:
	device_configuration.setCalculator(
	    calculator(electrode_voltages=(0.5*bias,-0.5*bias)),
	    initial_spin=initial_spin,
            [i]initial_state=device_configuration,[/i]
	)
	device_configuration.update()
	nlsave('%.1f.nc' % bias.inUnitsOf(Volt), device_configuration)
    So we can set lower bias convergenced configuration as intial state to calculate .nc file under high bias, is that ok?         best

Offline Jess Wellendorff

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 933
  • Country: dk
  • Reputation: 29
    • View Profile
Re: how do we calculate spin transport in finite bias?
« Reply #5 on: March 17, 2017, 11:09 »
Using a converged calculation for bias voltage 0.1 V as initial state for calculation as 0.2 V is in general a good idea. Note that SCF convergence becomes harder with increased bias.

Offline wot19920302

  • QuantumATK Guru
  • ****
  • Posts: 124
  • Country: cn
  • Reputation: 0
    • View Profile
Re: how do we calculate spin transport in finite bias?
« Reply #6 on: March 17, 2017, 11:55 »
thank you,sir ;D. so you think use a converged calculation for bias voltage 0.1 V as initial state for calculation as 0.2 V and then set inital-spin again may be proper ,right?

Offline wot19920302

  • QuantumATK Guru
  • ****
  • Posts: 124
  • Country: cn
  • Reputation: 0
    • View Profile
Re: how do we calculate spin transport in finite bias?
« Reply #7 on: March 19, 2017, 05:13 »
anyone can help me, please?  ???

Offline Petr Khomyakov

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 1290
  • Country: dk
  • Reputation: 25
    • View Profile
Re: how do we calculate spin transport in finite bias?
« Reply #8 on: March 20, 2017, 13:06 »
Yes, you are right.

Offline wot19920302

  • QuantumATK Guru
  • ****
  • Posts: 124
  • Country: cn
  • Reputation: 0
    • View Profile
Re: how do we calculate spin transport in finite bias?
« Reply #9 on: March 21, 2017, 03:43 »
thank you sir :D

Offline wot19920302

  • QuantumATK Guru
  • ****
  • Posts: 124
  • Country: cn
  • Reputation: 0
    • View Profile
Re: how do we calculate spin transport in finite bias?
« Reply #10 on: April 8, 2017, 03:58 »
 sir, according to your descriptions above, I make tests again to calculate spin-denpendent IV-curves for AP configuration (i.e antiparallel spin orient in two electrodes) to  inspect the results using three methods I mentioned above, the result is very interesting        scripts of three methods are compressed into scripts.zip .        method 1.  firstly,  calculate AP configuration under 0v bias, get convergenced  AP-0V.nc file (see ap-1-zero.py in scripts.zip). Then set AP-0V.nc as initial state, apply finite 0.2v bias,  get AP-0.2v.nc. Thirdly,  use AP-0.2v as initla state, apply bias=0.4v anad get AP-0.4v.nc.... Every scf under high bias using low bias *nc file as initial state.  No initial-spin set again when performing scf under finite bias. (ap-1-bias-posi.py attahced in scripts.zip)        method 2.  calculate spin-dependent current under every bias. the core code is :        
Code
 for bias in biases:
	device_configuration.setCalculator(
	    calculator(electrode_voltages=(0.5*bias,-0.5*bias)),
	    initial_spin=initial_spin,
	)
	device_configuration.update()
       In every scf , Initial_spin is set again (the explict script is given in ap-2-initialspin-posi.py in scripts.zip )             method 3.   firstly,  calculate AP configuration under 0v bias,get convergenced  AP-0V.nc file. set AP-0V.nc as initial state, apply finite 0.2v bias,  get AP-0.2v.nc. Thirdly,  use AP-0.2v as initla state, apply bias=0.4v anad get AP-0.4v.nc....  every scf under high bias using low bias *nc file as initial state.  in fact, method3 is the similar to method1. the only difference is that every scf I set inital_spin again in methode 3. the core code is :      
Code
 for bias in biases:
	device_configuration.setCalculator(
	    calculator(electrode_voltages=(0.5*bias,-0.5*bias)),
	    initial_spin=initial_spin,
	    initial_state=device_configuration
	)
	device_configuration.update()
    (the explict script see ap-3-initialspin-initialstate-posi.py  in scripts.zip )        the results of the three methods above are shown in fig1 and fig2.  fig1 is IV curve for spin_up and fig2 for spin_down. ap-1, ap-2, ap-3 means method 1, method 2 and method 3 ,respectively. As we can see. ap-1 is symmetry under positive and negative. I think the system maybe convergenced into P-configuration under finite bias.   for ap-2, IV shows rectification both for spin_up and spin_down.  so method 2 can  keep  AP-configuration undr finite bias. for ap-3, the result is very interesting: the curve is zigzag along bias. and the value of current equals current of P-configuration and AP-configuration alternately. I think the system change between AP-P-AP-P...alternately under finite bias.         Based on the IV curves. I get some conclusions and also have some problems:         1. accroding to method 3, it seems that initial_spin takes effect by mulitiplying spin distribution of electrical configuration of last bias instead of "covering(replacing)" spin distribution of electrical configuration. e.g.  if spin distribution of last bias is 0.6, 0.8, 0.2 for three atoms,then we apply inital_spin=0.2,-0.5,0.6, the finally inital spin is 0.6*0.2=0.12, 0.8*(-0.5)=-0.4, 0.2*0.6=0.12. Only in this way can ap-3 transform from AP-P-AP-P....        2.In method2, device_configuration  update in loop, does it mean we use convergenced *.nc of low bias as intial guess in every scf ? I think the answer is "no". Because if the answer is "yes",  the results of method2 and method3 should be the same.   In other words, method2 directly use  device_configuration = DeviceConfiguration( central_region, [left_electrode, right_electrode] )  to calculate electrical configuration under bias=0.0, 0.2V, 0.4V,0.6V, respectively.        3. I read  *.out file  of method2 and find in every scf, atk calculate right electrode, left electrode, equilibrium bulk and device , in fact  right electrode, left electrode and equilibrium buik is the same in every loop. I think this repeat is time-consuming.  Can we just calculate right electrode, left electrode, and equilibrium bulk once in the wholeloop?        4. I think initial_spin setting in VNL is a little inconvenient. I think if spin_scales  could show up on correspond atoms,  it would be more vconvenient. What's more, if we can select some atoms to set inital_scale simultaneously by ctrl or draw a shape , initial_spin setting would be more quick.       Best ;D
« Last Edit: April 8, 2017, 04:26 by wot19920302 »

Offline wot19920302

  • QuantumATK Guru
  • ****
  • Posts: 124
  • Country: cn
  • Reputation: 0
    • View Profile
Re: how do we calculate spin transport in finite bias?
« Reply #11 on: April 10, 2017, 09:50 »
anyone can help me, please? :o

Offline Petr Khomyakov

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 1290
  • Country: dk
  • Reputation: 25
    • View Profile
Re: how do we calculate spin transport in finite bias?
« Reply #12 on: April 10, 2017, 23:00 »
Regarding #2, the answer is "no" as you say.

Regarding #3, you may first do left and right electrodes in a separate calculation and save the left and right electrode configurations into the corresponding nc-files:

....
left_electrode.setCalculator(left_electrode_calculator)
left_electrode.update()
nlsave('left_electrode.nc', left_electrode)
right_electrode.setCalculator(right_electrode_calculator)
right_electrode.update()
nlsave('right_electrode.nc', right_electrode)


And you may then just read the electrode configurations from the nc-files (instead of actually doing electrode calculations) while  doing the device calculations for different bias voltages:

left_electrode = nlread("left_electrode.nc")[0]
right_electrode = nlread("right_electrode.nc")[0]
.....

Offline wot19920302

  • QuantumATK Guru
  • ****
  • Posts: 124
  • Country: cn
  • Reputation: 0
    • View Profile
Re: how do we calculate spin transport in finite bias?
« Reply #13 on: April 11, 2017, 13:02 »
thank you, sir !I will try later ;D