Giter VIP home page Giter VIP logo

ts-tbt-sisl-tutorial's Introduction

GitHub release (latest by date) Join discussion on Discord Binder License

Welcome to sisl + TBtrans + TranSiesta tutorial

This is the tutorial used for sisl + TBtrans + TranSiesta workshops.

The sources used for these tutorials can be found elsewhere:

If you have installed using the installation script you will have access to MPI parallelized executables.

Binder

This tutorial may be runned using Binder. Note that we highly recommend using a local Conda installation since that is much more versatile and since this tutorial requires lots of text-editing which is hard to do in a Jupyter notebook.

However, if you want to play around you may do so, for a good experience you are recommended to execute tbtrans like this:

!OMP_NUM_THREADS=1 tbtrans RUN.fdf

since the installed tbtrans is threaded and binder is sharing resources.

License

sisl © 2020 by Nick Papior is licensed under CC BY-SA 4.0. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/

ts-tbt-sisl-tutorial's People

Contributors

ialcon avatar jan-janssen avatar zerothi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ts-tbt-sisl-tutorial's Issues

siesta band structure + selected fatbands

I've just started learning sisl. I wonder if it is possible to get band structure with selected fatbands. I include example of a figure I mean obtained from VASP calculations in p4v.

Thank you for help.

Elwira

gd-graph-sic_und_gr_C32-39-p_elec

How to limit parallel resources for siesta calculation?

I installed siesta using the command conda install -c conda-forge "siesta=*=openmpi", but running siesta without any additional options causes it to use all available CPUs on my computer. I would like to limit the parallel calculation to only 16 CPUs.

Can anyone provide guidance on how to set the number of CPUs used in siesta calculations?

I am using Ubuntu 20.04.1 and have installed openmpi-4.1.5.

Error while running all py

Traceback (most recent call last):
File "run.py", line 3, in
import sisl
File "/home/mandar/.local/lib/python2.7/site-packages/sisl/init.py", line 93, in
from . import utils
File "/home/mandar/.local/lib/python2.7/site-packages/sisl/utils/init.py", line 41, in
from . import mathematics as math
File "/home/mandar/.local/lib/python2.7/site-packages/sisl/utils/mathematics.py", line 8, in
from sisl._indices import indices_le
ImportError: No module named _indices

Placeholder for 2017 requested examples input fdf files

I should have made the ipynb write out all files (except C.psf). Here they are for completeness sake:

  • RUNk.fdf
SystemLabel k

TBT.HS DEVICE.nc

TBT.Symmetry.TimeReversal f

TBT.k [400 1 1]

TBT.Contours.Eta 1e-4 eV

TBT.DOS.Gf true
TBT.DOS.A true

%block TBT.Elec.Left
  HS ELEC.nc
  semi-inf-direction -A2
  electrode-position 1
%endblock TBT.Elec.Left
%block TBT.Elec.Right
  HS ELEC.nc
  semi-inf-direction +A2
  electrode-position end -1
%endblock TBT.Elec.Right
  • RUN_TS_ELEC.fdf
SystemLabel ELEC

%include STRUCT_ELEC.fdf

%block kgrid.MonkhorstPack
    100   0  0 0.
    0  10  0 0.
    0   0  1 0.
%endblock kgrid.MonkhorstPack

PAO.BasisSize         SZP
PAO.EnergyShift       0.01 Ry
XC.functional     GGA
XC.authors        PBE
MeshCutoff        250.000000 Ry
FilterCutoff      150.000000 Ry

ElectronicTemperature   300 K
OccupationFunction      FD

MinSCFIterations       3
MaxSCFIterations       200
SCF.DM.Tolerance       0.0001
# Mixing parameters:
SCF.Mixer.Weight       0.10
SCF.Mixer.History      12
SCF.Mix.First          true
DM.UseSaveDM           .true.

MD.NumCGSteps 0

SaveHS                          T
  • RUN_TS.fdf
SolutionMethod transiesta

TBT.Contour.Eta 1e-4 eV
TBT.k [1 150 1]
%block TBT.Contours
  all
%endblock

%block TBT.Contour.all
   from -16 eV to 0. eV
    delta 0.02 eV
      method mid-rule
%endblock

%block TBT.Contour.low
   from -16 eV to -14 eV
    delta 0.02 eV
      method mid-rule
%endblock

%block TBT.Contour.high
   from -2 eV to 0. eV
    delta 0.02 eV
      method mid-rule
%endblock

TBT.DOS.Gf true
TBT.DOS.A true
TBT.DOS.A.All true

%block kgrid.MonkhorstPack
    3  0  0 0.
    0 10  0 0.
    0  0  1 0.
%endblock kgrid.MonkhorstPack

TS.Voltage 0 eV

%block TS.ChemPots
  Fermi
%endblock TS.ChemPots

%block TS.ChemPot.Fermi
  mu 0. eV
  contour.eq
    begin
      C-Fermi
      T-Fermi
    end
%endblock

TS.Contours.Eq.Pole 2.5 eV
%block TS.Contour.C-Fermi
  part circle
   from -40. eV to -10 kT
     points 25
      method g-legendre
%endblock
%block TS.Contour.T-Fermi
  part tail
   from prev to inf
     points 10
      method g-fermi
%endblock

%block TS.Elecs
  Left
  Right
%endblock TS.Elecs

%block TS.Elec.Left
  HS ELEC.TSHS
  semi-inf-direction -a1
  electrode-position 1
%endblock
%block TS.Elec.Right
  HS ELEC.TSHS
  semi-inf-direction +a1
  electrode-position end -1
%endblock

PAO.BasisSize         SZP

XC.functional     GGA
XC.authors        PBE
MeshCutoff        250.000000 Ry
FilterCutoff      150.000000 Ry

ElectronicTemperature   300 K

MinSCFIterations       3
SCF.DM.Tolerance       0.0001
# Mixing parameters:
SCF.Mixer.Weight       0.10
SCF.Mixer.History      12
SCF.Mix.First          true
DM.UseSaveDM           true

SaveHS                          T

%include STRUCT_DEVICE.fdf

About tutorial

Hello Nick,
I met some problems running the sisl tutorials.
In TB_01:

for ia, io in H:

You intended to enumerate atomic and orbital indices, but actually when using for i in H:, it
enumerates the indices of nonzero terms in H, for example running:

graphene = sisl.geom.graphene()
H = sisl.Hamiltonian(graphene)
H[0, 0] = 0.0
H[1, 1] = 0.0
H[0, 1] = -2.7
H[1, 0] = -2.7
H[0, 1, (-1, 0)] = -2.7
H[0, 1, (0, -1)] = -2.7
H[1, 0, (1, 0)] = -2.7
H[1, 0, (0, 1)] = -2.7
for ia, io in H:
    print(ia,io)


Output is:

0 0
0 1
0 9
0 5
1 1
1 0
1 10
1 14

In TB_04 about edge atom indice:

for ia in device.close(device.center(what='cell'), R=14.):
    if len(device.close(ia, R=1.43)) < 4:
        edge.append(ia + 1) # + 1 to get fortran indices

Why do you use fortran indices in the following code? When you plot the edge atom DOS later, and call tbt.DOS(atom=edge, norm='atom'), should you use python indices here?

In TB_05,


dangling = [ia for ia in H.geom.close(H.geom.center(what='cell'), R=14.)
                if len(H.edges(ia)) < 2]
H = H.remove(dangling)
# + 1 to get fortran indices
edge = [ia + 1 for ia in H.geom.close(H.geom.center(what='cell'), R=14.)
         if len(H.edges(ia)) < 3]

Should the two inequality be <3 and <4, as in TB_04? Since H.edges(ia) returns itself too.

Thank you!

About the gate calculation

Hi, @zerothi,
I try to calculate the electronic transport properties of a graphene nanojunction with a charge gate using the Geometry.Charge block and I have two questions about the calculation details.

  • Should the option SlabDipoleCorrection be chosen? In the Method part of your paper published in PCCP the slab dipole correction was used, however I did not find this option in the fdf file.

  • If I put a charge -e in the gate plane, how to induce a charge +e in the graphene nanojunction to keep the whole system (the graphene nanojunction + gate) neutral?

Thanks for your kind help.
 
Regards,
Haoyang

Erroneous electrode setup, check out-put

I was trying to do two nanotubes, one in the other, in magnetic field. However, when I try to do tbtrans calculations, I get an error: Erroneous electrode setup, check out-put. My code:
import math
import sisl
import numpy as np
import matplotlib.pyplot as plt
from tqdm import tqdm
from functools import partial
%matplotlib inline
elec_in = sisl.geom.nanotube(1, atoms=sisl.Atom(6, R=5+0.01), chirality=(6, 6))
nano_in = elec_in.tile(10, 2)
elec_out = sisl.geom.nanotube(1, atoms=sisl.Atom(6, R=5+0.01), chirality=(11, 11))
nano_out = elec_out.tile(10, 2)
elec_out = elec_out.translate([(elec_in.xyz[:, 0].max()-elec_out.xyz[:, 0].max())/2, 0, 0])
elec_out = elec_out.translate([0, (elec_in.xyz[:, 1].max()-elec_out.xyz[:, 1].max())/2, 0])
elec_out = elec_out.translate([0, 0, -elec_in.xyz[:, 2].max()])
elec = elec_in.append(elec_out, 2)
H_elec = sisl.Hamiltonian(elec)
H_elec.construct([[0.1, 1.43], [0., -2.7]])
H_elec.write('ELEC.nc')
nano_out = nano_out.translate([(nano_in.xyz[:, 0].max()-nano_out.xyz[:, 0].max())/2, 0, 0])
nano_out = nano_out.translate([0, (nano_in.xyz[:, 1].max()-nano_out.xyz[:, 1].max())/2, 0])
nano_out = nano_out.translate([0, 0, -nano_in.xyz[:, 2].max()])
device = nano_in.append(nano_out, 2)
H = sisl.Hamiltonian(device)
H.construct(([0.1, 1.43], [0., -2.7]))
H.write('DEVICE.nc')
xy = sisl.Hamiltonian(device)
for ia in device:
edges = H.edges(ia)
Rij = device.Rij(ia, edges)
xy[ia, edges] = Rij[:, 0] * (Rij[:, 1] + 2 * device.xyz[ia, 1])
xy.finalize()
rec_phis = np.arange(1, 51, 4)
for i, rec_phi in enumerate(tqdm(rec_phis, unit="M")):
phi = 1 / rec_phi
dH = H * np.exp(1.0j * xy * 0.5 / rec_phi) - H
with sisl.get_sile('M_{}.dH.nc'.format(rec_phi), mode='w') as fh:
fh.write_delta(dH)

<< 2018 Tutorial installation in Debian 9.8 >>

Hello,

Dear @zerothi ,

Sorry to bother you with this issue, We installed the tutorial using the installation script and, at the end, we got the following message:

This script assumes you are using Python 2.7

 Will try and run sisl
    import sisl ; print(sisl.geom.graphene())
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/icamps/.local/lib/python2.7/site-packages/sisl/__init__.py", line 90, in <module>
    from . import linalg
  File "/home/icamps/.local/lib/python2.7/site-packages/sisl/linalg/__init__.py", line 30, in <module>
    from .base import *
  File "/home/icamps/.local/lib/python2.7/site-packages/sisl/linalg/base.py", line 5, in <module>
    from numpy import atleast_1d, atleast_2d
  File "/home/icamps/.local/lib/python2.7/site-packages/numpy/__init__.py", line 140, in <module>
    from . import _distributor_init
ImportError: cannot import name _distributor_init
Failed running sisl, please mail the organizer with the error message (unless some of the installations failed)

I did not get any other messages.

Thanks in advance,

Camps

About TS_04 and general N>2 electrode

Hello Nick,
In your TS_04 tutorial, you said "Although we have 4 electrodes we will only use two different chemical potentials One for each chain."

In your vertical carbon chain setup in this tutorial, can one apply 0.5 V between y-1 and y-2 electrode, and apply 0.0 V between x-1 and x-2 electrode? So they will have chemical potenial:
x-1 0.0eV
x-2 0.0eV
y-1 0.25eV
y-2 -0.25eV

Is it allowed in TranSIESTA to have individual control over 4 different chemical potentials? I am trying to do so but have ran into various kinds of errors.

Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.