spin polarized tbtrans calculation

Bug #1658896 reported by Zhenfei Liu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Siesta
Fix Released
High
Nick Papior
4.1
Fix Released
High
Nick Papior

Bug Description

Hello, I tried to do spin polarized transport calculation, and I am first doing a sanity check of performing a spin polarized calculation for a physically spin unpolarized junction (i.e., just test the case where one has two spin component instead of one). The self-consistent transiesta calculation finished just as usual, but in the tbtrans, the calculation did not proceed beyond the first spin component. After the first spin component finishes as usual, the calculation immediately stopped at the beginning of the second spin component. I tracked the point where the code stopped, and it happens at:

line 746 of m_tbt_trik.F90

       if ( n_k == 0 ) then
          call create_HS(TSHS%dit, sp, 0._dp, &
               N_Elec, Elecs, TSHS%no_u, product(TSHS%nsc), &
               iE,H, S, TSHS%sc_off, &
               spH, spS, kpt, &
               nmaxwork, maxwork) ! not used...
       else
          call create_region_HS(TSHS%dit,sp, 0._dp, &
               TSHS%cell, n_k, r_k, TSHS%na_u, TSHS%lasto, &
               N_Elec, Elecs, TSHS%no_u, product(TSHS%nsc), &
               iE, H, S, TSHS%sc_off, spH, spS, &
               nmaxwork, maxwork)
       end if

I further tracked the create_HS in Src/m_ts_sparse_helper.F90, and the code actually stopped at:

line 234 of m_ts_sparse_helper.F90

          zH(ind_k) = zH(ind_k) + H(ind) * ph(jo)

The code stopped before the above line runs. Have the developers fully tested spin polarized tbtrans calculations and I am wondering are there any known issues here?

Thanks!

Tags: tbtrans
Revision history for this message
Nick Papior (nickpapior) wrote :

I will check. Thanks.

Could you try and add this flag:

TBT.Spin 2

This will only calculate for the second spin-component. In this way you can parallelize across spin-components easily.

Revision history for this message
Nick Papior (nickpapior) wrote :

I can successfully run a spin-polarized calculation with no problems.

Revision history for this message
Nick Papior (nickpapior) wrote :

Please carefully explain the steps you took, and attach the input files if you still reproduce the fault.

Revision history for this message
Nick Papior (nickpapior) wrote :

I have marked it as incomplete to clean up the bug-list and it wasn't reproducible.
Please return if your example keeps showing the behaviour.

Thanks!

Changed in siesta:
status: New → Incomplete
Revision history for this message
Zhenfei Liu (zfliu) wrote :

Hi Nick,

I attach a complete calculation, containing all the coordinates, pseudopotential, and input files. I first do left and right electrodes, and then do the self-consistent transport, and lastly do the tbtrans. This is a standard molecular junction with two electrodes, and the only difference is I set "spin polarized" here. This is a sanity check, as my molecular junction is a physically unpolarized case and I know the results well.

However as I mentioned before, the tbtrans only finished the UP component correctly, and crashes before the DN component calculation. As you suggested in a previous post, I then started a new tbtrans calculation in a new directory, but this time set 'TBT.Spin 2'. In other words I parallelize over spin component in two directories. I have checked that, the UP spin results (especially AVTRANS) match very well with the DN spin results (as it should, as my junction is physically spin unpolarized), and both match well with the standalone spin-unpolarized calculation (whose tbtrans finishes correctly as usual). This sanity check suggests that my spin-polarized self-consistent transiesta calculation indeed generated the right .TSHS file with two spin components, however the tbtrans utility somehow crashes after it correctly computes UP-spin component. The workaround for me right now is to start two tbtrans calculations at the same time (one for UP spin and one for DN spin, as you suggested in a previous post), so that I can still get correct results from both spin components. But, the tbtrans should have worked for both spin in a single run...

I am using siesta-4.1-b2. And I have only tested this attached system for two spin component calculation. I appreciate any insight from you on how to fix the tbtrans crash issue.

Thanks!

Revision history for this message
Nick Papior (nickpapior) wrote :

I narrowed down the mistake. It was recently introduced by me.

Sorry. The current workaround is to do the TBT.Spin option (which is the suggested work-flow for spin-polarized calculations).

I have attached a patch which may be applied and it fixes the issue.

Changed in siesta:
milestone: none → 4.1-b3
status: Incomplete → Fix Committed
importance: Undecided → Critical
assignee: nobody → Nick Papior (nickpapior)
Revision history for this message
Nick Papior (nickpapior) wrote :

Thanks! Please try the patch and report back.

Revision history for this message
Zhenfei Liu (zfliu) wrote :

Hi Nick, I can confirm that this patch you provided works perfectly in solving the problem. Thanks!

Revision history for this message
Nick Papior (nickpapior) wrote :

Great! :)

Nick Papior (nickpapior)
Changed in siesta:
importance: Critical → High
Nick Papior (nickpapior)
tags: added: tbtrans
Nick Papior (nickpapior)
Changed in siesta:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.