Author Topic: How to calculate the current after introducing spin-orbit coupling?  (Read 4660 times)

0 Members and 1 Guest are viewing this topic.

Offline guojunnan

  • Regular QuantumATK user
  • **
  • Posts: 6
  • Country: cn
  • Reputation: 0
    • View Profile
I want to calculate the current of a device after the introduction of spin-orbit coupling, and I need to see the spin-up and spin-down currents after the introduction of spin-orbit coupling? But my calculations can only yield currents in the xyz direction? How should I adjust it?

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5589
  • Country: dk
  • Reputation: 102
    • View Profile
    • QuantumATK at Synopsys
First of all, spin up and down are not good quantum numbers anymore when you introduce spin-orbit coupling (or noncollinear spin).

But it should still be possible to project the current on Up or Down in a script. Can you share more about the script you run and error message?
« Last Edit: March 26, 2024, 19:25 by Anders Blom »

Offline guojunnan

  • Regular QuantumATK user
  • **
  • Posts: 6
  • Country: cn
  • Reputation: 0
    • View Profile
Thank you very much for your answer, as I was recently interested in this article (https://journals.aps.org/prb/abstract/10.1103/PhysRevB.108.125419) that's why I wanted to try to find out how to calculate the spin-up and spin-down currents after introducing the spin-orbit coupling,as I wanted to transform the theoretical model into a device model to calculate the transport properties.
The thing that bothers me the most is that I don't know how to project the current up or down in a script.
Here is my script.I'm looking forward to your replies and guidance

# -*- coding: utf-8 -*-
# -------------------------------------------------------------
# Two-probe Configuration
# -------------------------------------------------------------

# -------------------------------------------------------------
# Left Electrode
# -------------------------------------------------------------

# Set up lattice
vector_a = [15.0, 0.0, 0.0]*Angstrom
vector_b = [9.18485099360515e-16, 15.0, 0.0]*Angstrom
vector_c = [0.0, 0.0, 7.0637512743]*Angstrom
left_electrode_lattice = UnitCell(vector_a, vector_b, vector_c)

# Define elements
left_electrode_elements = [Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold,
                           Gold]

# Define coordinates
left_electrode_coordinates = [[  7.1907375    ,   6.671025     ,   1.17729901125],
                              [ 10.0745025    ,   6.671025     ,   1.17729901125],
                              [  5.7488625    ,   9.168435     ,   1.17729901125],
                              [  8.6326275    ,   9.168435     ,   1.17729901125],
                              [  5.7488625    ,   7.503495     ,   3.5318775823 ],
                              [  8.6326125    ,   7.503495     ,   3.5318775823 ],
                              [  4.3069725    ,  10.000905     ,   3.5318775823 ],
                              [  7.1907375    ,  10.000905     ,   3.5318775823 ],
                              [  5.7488625    ,   5.838555     ,   5.88645226305],
                              [  8.6326125    ,   5.838555     ,   5.88645226305],
                              [  4.3069725    ,   8.335965     ,   5.88645226305],
                              [  7.1907375    ,   8.335965     ,   5.88645226305]]*Angstrom

# Set up configuration
left_electrode = BulkConfiguration(
    bravais_lattice=left_electrode_lattice,
    elements=left_electrode_elements,
    cartesian_coordinates=left_electrode_coordinates
    )

# -------------------------------------------------------------
# Right Electrode
# -------------------------------------------------------------

# Set up lattice
vector_a = [15.0, 0.0, 0.0]*Angstrom
vector_b = [9.18485099360515e-16, 15.0, 0.0]*Angstrom
vector_c = [0.0, 0.0, 7.063755164599996]*Angstrom
right_electrode_lattice = UnitCell(vector_a, vector_b, vector_c)

# Define elements
right_electrode_elements = [Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold,
                            Gold]

# Define coordinates
right_electrode_coordinates = [[  6.662341185865,   6.369654444235,   1.17729901125 ],
                               [  9.546091185865,   6.369654444235,   1.17729901125 ],
                               [  5.220451185865,   8.867064444235,   1.17729901125 ],
                               [  8.104216185865,   8.867064444235,   1.17729901125 ],
                               [  6.662341185865,   8.034594444235,   3.53185813085 ],
                               [  9.546091185865,   8.034594444235,   3.53185813085 ],
                               [  5.220451185865,  10.532004444235,   3.53185813085 ],
                               [  8.104216185865,  10.532004444235,   3.53185813085 ],
                               [  8.104216185865,   7.202124444235,   5.88645615335 ],
                               [ 10.987981185865,   7.202124444235,   5.88645615335 ],
                               [  6.662341185865,   9.699534444235,   5.88645615335 ],
                               [  9.546091185865,   9.699534444235,   5.88645615335 ]]*Angstrom

# Set up configuration
right_electrode = BulkConfiguration(
    bravais_lattice=right_electrode_lattice,
    elements=right_electrode_elements,
    cartesian_coordinates=right_electrode_coordinates
    )

# -------------------------------------------------------------
# Central Region
# -------------------------------------------------------------

# Set up lattice
vector_a = [15.0, 0.0, 0.0]*Angstrom
vector_b = [9.18485099360515e-16, 15.0, 0.0]*Angstrom
vector_c = [3.061616997868383e-15, 3.061616997868383e-15, 38.454696774010465]*Angstrom
central_region_lattice = UnitCell(vector_a, vector_b, vector_c)

# Define elements
central_region_elements = [Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold,
                           Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold,
                           Gold, Gold, Gold, Hydrogen, Carbon, Hydrogen, Carbon, Carbon,
                           Carbon, Carbon, Hydrogen, Carbon, Hydrogen, Hydrogen, Carbon,
                           Hydrogen, Nitrogen, Hydrogen, Hydrogen, Carbon, Hydrogen, Gold,
                           Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold,
                           Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold,
                           Gold, Gold]

# Define coordinates
central_region_coordinates = [[  7.1907375     ,   6.671025      ,   1.17729901125 ],
                              [ 10.0745025     ,   6.671025      ,   1.17729901125 ],
                              [  5.7488625     ,   9.168435      ,   1.17729901125 ],
                              [  8.6326275     ,   9.168435      ,   1.17729901125 ],
                              [  5.7488625     ,   7.503495      ,   3.5318775823  ],
                              [  8.6326125     ,   7.503495      ,   3.5318775823  ],
                              [  4.3069725     ,  10.000905      ,   3.5318775823  ],
                              [  7.1907375     ,  10.000905      ,   3.5318775823  ],
                              [  5.7488625     ,   5.838555      ,   5.88645226305 ],
                              [  8.6326125     ,   5.838555      ,   5.88645226305 ],
                              [  4.3069725     ,   8.335965      ,   5.88645226305 ],
                              [  7.1907375     ,   8.335965      ,   5.88645226305 ],
                              [  7.1907375     ,   6.671025      ,   8.24105028555 ],
                              [ 10.0745025     ,   6.671025      ,   8.24105028555 ],
                              [  5.7488625     ,   9.168435      ,   8.24105028555 ],
                              [  8.6326275     ,   9.168435      ,   8.24105028555 ],
                              [  5.7488625     ,   7.503495      ,  10.59560940515 ],
                              [  8.6326125     ,   7.503495      ,  10.59560940515 ],
                              [  4.3069725     ,  10.000905      ,  10.59560940515 ],
                              [  7.1907375     ,  10.000905      ,  10.59560940515 ],
                              [  5.7488625     ,   5.838555      ,  12.95016852475 ],
                              [  8.6326125     ,   5.838555      ,  12.95016852475 ],
                              [  4.3069725     ,   8.335965      ,  12.95016852475 ],
                              [  7.1907375     ,   8.335965      ,  12.95016852475 ],
                              [  7.1907375     ,   6.671025      ,  14.66018439715 ],
                              [  7.5971775     ,   9.163875      ,  16.53717151635 ],
                              [  7.6306125     ,   7.07118       ,  16.62544219645 ],
                              [  7.7716125     ,   4.999095      ,  17.08099515545 ],
                              [  7.7615325     ,   8.356965      ,  17.14323979545 ],
                              [  7.8641325     ,   5.945415      ,  17.45500763605 ],
                              [  8.1154275     ,   8.5434        ,  18.49390958055 ],
                              [  8.2241325     ,   6.14085       ,  18.80163151955 ],
                              [  8.1996375     ,   9.502425      ,  18.84049551665 ],
                              [  8.3453025     ,   7.43991       ,  19.35090156465 ],
                              [  8.3952975     ,   5.313585      ,  19.37848372075 ],
                              [ 10.6930275     ,   7.5312        ,  20.46784272655 ],
                              [  8.6974575     ,   7.629105      ,  20.78906397185 ],
                              [  8.7963525     ,   8.69124       ,  21.03131233015 ],
                              [ 10.0186125     ,   7.044675      ,  21.06297929075 ],
                              [  6.6569775     ,   7.51299       ,  21.56377632245 ],
                              [  7.5273975     ,   5.97462       ,  21.64905147925 ],
                              [  7.6306125     ,   7.056435      ,  21.75506188175 ],
                              [ 10.2633675     ,   7.272105      ,  22.02944403545 ],
                              [  8.104216185865,   7.202124444235,  23.79450848656 ],
                              [  6.662341185865,   6.369654444235,  25.50452435896 ],
                              [  9.546091185865,   6.369654444235,  25.50452435896 ],
                              [  5.220451185865,   8.867064444235,  25.50452435896 ],
                              [  8.104216185865,   8.867064444235,  25.50452435896 ],
                              [  6.662341185865,   8.034594444235,  27.85908347856 ],
                              [  9.546091185865,   8.034594444235,  27.85908347856 ],
                              [  5.220451185865,  10.532004444235,  27.85908347856 ],
                              [  8.104216185865,  10.532004444235,  27.85908347856 ],
                              [  8.104216185865,   7.202124444235,  30.21364259816 ],
                              [ 10.987981185865,   7.202124444235,  30.21364259816 ],
                              [  6.662341185865,   9.699534444235,  30.21364259816 ],
                              [  9.546091185865,   9.699534444235,  30.21364259816 ],
                              [  6.662341185865,   6.369654444235,  32.56824062066 ],
                              [  9.546091185865,   6.369654444235,  32.56824062066 ],
                              [  5.220451185865,   8.867064444235,  32.56824062066 ],
                              [  8.104216185865,   8.867064444235,  32.56824062066 ],
                              [  6.662341185865,   8.034594444235,  34.92279974026 ],
                              [  9.546091185865,   8.034594444235,  34.92279974026 ],
                              [  5.220451185865,  10.532004444235,  34.92279974026 ],
                              [  8.104216185865,  10.532004444235,  34.92279974026 ],
                              [  8.104216185865,   7.202124444235,  37.27739776276 ],
                              [ 10.987981185865,   7.202124444235,  37.27739776276 ],
                              [  6.662341185865,   9.699534444235,  37.27739776276 ],
                              [  9.546091185865,   9.699534444235,  37.27739776276 ]]*Angstrom

# Set up configuration
central_region = BulkConfiguration(
    bravais_lattice=central_region_lattice,
    elements=central_region_elements,
    cartesian_coordinates=central_region_coordinates
    )

device_configuration = DeviceConfiguration(
    central_region,
    [left_electrode, right_electrode],
    equivalent_electrode_lengths=[7.0637512743, 7.0637551646]*Angstrom,
    transverse_electrode_repetitions=[[1, 1], [1, 1]],
    )

# Add tags
device_configuration.addTags('Selection 0', [ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12,
                                             13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
                                             26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
                                             39, 40, 41, 42])
device_configuration.addTags('Selection 1', [43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
                                             56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67])

# -------------------------------------------------------------
# Calculator
# -------------------------------------------------------------
#----------------------------------------
# Basis Set
#----------------------------------------
HydrogenBasis = OpenMXBasisSet(
    element=PeriodicTable.Hydrogen,
    filename="openmx/pao/H5.0.pao.zip",
    atomic_species="s2p1",
    hubbard_u=[0.0, 0.0, 0.0]*eV,
    dft_half_parameters=Automatic,
    filling_method=SphericalSymmetric,
    onsite_spin_orbit_split=[0.0, 0.0, 0.0]*eV,
    pseudopotential=NormConservingPseudoPotential("normconserving/upf2/H_PBE13.upf.zip"),
    )

CarbonBasis = OpenMXBasisSet(
    element=PeriodicTable.Carbon,
    filename="openmx/pao/C6.0.pao.zip",
    atomic_species="s2p2d1",
    hubbard_u=[0.0, 0.0, 0.0, 0.0, 0.0]*eV,
    dft_half_parameters=Automatic,
    filling_method=SphericalSymmetric,
    onsite_spin_orbit_split=[0.0, 0.0, 0.0, 0.0, 0.0]*eV,
    pseudopotential=NormConservingPseudoPotential("normconserving/upf2/C_PBE13.upf.zip"),
    )

NitrogenBasis = OpenMXBasisSet(
    element=PeriodicTable.Nitrogen,
    filename="openmx/pao/N6.0.pao.zip",
    atomic_species="s2p2d1",
    hubbard_u=[0.0, 0.0, 0.0, 0.0, 0.0]*eV,
    dft_half_parameters=Automatic,
    filling_method=SphericalSymmetric,
    onsite_spin_orbit_split=[0.0, 0.0, 0.0, 0.0, 0.0]*eV,
    pseudopotential=NormConservingPseudoPotential("normconserving/upf2/N_PBE13.upf.zip"),
    )

basis_set = [
    HydrogenBasis,
    CarbonBasis,
    NitrogenBasis,
    BasisGGAPseudoDojoSO.Gold_Medium,
    ]

#----------------------------------------
# Exchange-Correlation
#----------------------------------------
exchange_correlation = SOGGA.PBE

#----------------------------------------
# Numerical Accuracy Settings
#----------------------------------------
device_k_point_sampling = MonkhorstPackGrid(
    nc=100,
    force_timereversal=False,
    )
device_numerical_accuracy_parameters = NumericalAccuracyParameters(
    k_point_sampling=device_k_point_sampling,
    exx_grid_cutoff=75.0*Hartree,
    density_mesh_cutoff=75.0*Hartree,
    )

#----------------------------------------
# Device Calculator
#----------------------------------------
calculator = DeviceLCAOCalculator(
    basis_set=basis_set,
    exchange_correlation=exchange_correlation,
    numerical_accuracy_parameters=device_numerical_accuracy_parameters,
    )

device_configuration.setCalculator(calculator)

# -------------------------------------------------------------
# Initial State
# -------------------------------------------------------------
scaled_spins = [
    (0, 1.0, 0.0*Degrees, 0.0*Degrees),
    (1, 1.0, 0.0*Degrees, 0.0*Degrees),
    (2, 1.0, 0.0*Degrees, 0.0*Degrees),
    (3, 1.0, 0.0*Degrees, 0.0*Degrees),
    (4, 1.0, 0.0*Degrees, 0.0*Degrees),
    (5, 1.0, 0.0*Degrees, 0.0*Degrees),
    (6, 1.0, 0.0*Degrees, 0.0*Degrees),
    (7, 1.0, 0.0*Degrees, 0.0*Degrees),
    (8, 1.0, 0.0*Degrees, 0.0*Degrees),
    (9, 1.0, 0.0*Degrees, 0.0*Degrees),
    (10, 1.0, 0.0*Degrees, 0.0*Degrees),
    (11, 1.0, 0.0*Degrees, 0.0*Degrees),
    (12, 1.0, 0.0*Degrees, 0.0*Degrees),
    (13, 1.0, 0.0*Degrees, 0.0*Degrees),
    (14, 1.0, 0.0*Degrees, 0.0*Degrees),
    (15, 1.0, 0.0*Degrees, 0.0*Degrees),
    (16, 1.0, 0.0*Degrees, 0.0*Degrees),
    (17, 1.0, 0.0*Degrees, 0.0*Degrees),
    (18, 1.0, 0.0*Degrees, 0.0*Degrees),
    (19, 1.0, 0.0*Degrees, 0.0*Degrees),
    (20, 1.0, 0.0*Degrees, 0.0*Degrees),
    (21, 1.0, 0.0*Degrees, 0.0*Degrees),
    (22, 1.0, 0.0*Degrees, 0.0*Degrees),
    (23, 1.0, 0.0*Degrees, 0.0*Degrees),
    (24, 1.0, 0.0*Degrees, 0.0*Degrees),
    (25, 0.0, 0.0*Degrees, 0.0*Degrees),
    (26, 0.0, 0.0*Degrees, 0.0*Degrees),
    (27, 0.0, 0.0*Degrees, 0.0*Degrees),
    (28, 0.0, 0.0*Degrees, 0.0*Degrees),
    (29, 0.0, 0.0*Degrees, 0.0*Degrees),
    (30, 0.0, 0.0*Degrees, 0.0*Degrees),
    (31, 0.0, 0.0*Degrees, 0.0*Degrees),
    (32, 0.0, 0.0*Degrees, 0.0*Degrees),
    (33, 0.0, 0.0*Degrees, 0.0*Degrees),
    (34, 0.0, 0.0*Degrees, 0.0*Degrees),
    (35, 0.0, 0.0*Degrees, 0.0*Degrees),
    (36, 0.0, 0.0*Degrees, 0.0*Degrees),
    (37, 0.0, 0.0*Degrees, 0.0*Degrees),
    (38, 0.0, 0.0*Degrees, 0.0*Degrees),
    (39, 0.0, 0.0*Degrees, 0.0*Degrees),
    (40, 0.0, 0.0*Degrees, 0.0*Degrees),
    (41, 0.0, 0.0*Degrees, 0.0*Degrees),
    (42, 0.0, 0.0*Degrees, 0.0*Degrees),
    (43, 1.0, 0.0*Degrees, 0.0*Degrees),
    (44, 1.0, 0.0*Degrees, 0.0*Degrees),
    (45, 1.0, 0.0*Degrees, 0.0*Degrees),
    (46, 1.0, 0.0*Degrees, 0.0*Degrees),
    (47, 1.0, 0.0*Degrees, 0.0*Degrees),
    (48, 1.0, 0.0*Degrees, 0.0*Degrees),
    (49, 1.0, 0.0*Degrees, 0.0*Degrees),
    (50, 1.0, 0.0*Degrees, 0.0*Degrees),
    (51, 1.0, 0.0*Degrees, 0.0*Degrees),
    (52, 1.0, 0.0*Degrees, 0.0*Degrees),
    (53, 1.0, 0.0*Degrees, 0.0*Degrees),
    (54, 1.0, 0.0*Degrees, 0.0*Degrees),
    (55, 1.0, 0.0*Degrees, 0.0*Degrees),
    (56, 1.0, 0.0*Degrees, 0.0*Degrees),
    (57, 1.0, 0.0*Degrees, 0.0*Degrees),
    (58, 1.0, 0.0*Degrees, 0.0*Degrees),
    (59, 1.0, 0.0*Degrees, 0.0*Degrees),
    (60, 1.0, 0.0*Degrees, 0.0*Degrees),
    (61, 1.0, 0.0*Degrees, 0.0*Degrees),
    (62, 1.0, 0.0*Degrees, 0.0*Degrees),
    (63, 1.0, 0.0*Degrees, 0.0*Degrees),
    (64, 1.0, 0.0*Degrees, 0.0*Degrees),
    (65, 1.0, 0.0*Degrees, 0.0*Degrees),
    (66, 1.0, 0.0*Degrees, 0.0*Degrees),
    (67, 1.0, 0.0*Degrees, 0.0*Degrees),
]
initial_spin = InitialSpin(scaled_spins=scaled_spins)

device_configuration.setCalculator(
    calculator,
    initial_spin=initial_spin,
)
device_configuration.update()
nlsave('iv-SOGGA-p-1.hdf5', device_configuration)
nlprint(device_configuration)

# -------------------------------------------------------------
# IV Curve
# -------------------------------------------------------------
biases = [0.000000, 0.200000, 0.400000, 0.600000, 0.800000, 1.000000,
          1.200000, 1.400000, 1.600000, 1.800000, 2.000000]*Volt

kpoint_grid = KpointDensity(
    density_a=2.38732414638*Angstrom,
    density_c=0.0*Angstrom,
    force_timereversal=False,
    )

iv_curve = IVCurve(
    configuration=device_configuration,
    biases=biases,
    energies=numpy.linspace(-2,2,101)*eV,
    kpoints=kpoint_grid,
    self_energy_calculator=RecursionSelfEnergy(),
    energy_zero_parameter=AverageFermiLevel,
    infinitesimal=1e-06*eV,
    selfconsistent_configurations_filename_prefix="ivcurve_selfconsistent_configuration_",
    log_filename_prefix="ivcurve_"
    )
nlsave('iv-SOGGA-p-1.hdf5', iv_curve)
nlprint(iv_curve)

Offline guojunnan

  • Regular QuantumATK user
  • **
  • Posts: 6
  • Country: cn
  • Reputation: 0
    • View Profile
Sorry.This colour may not be clear as I've just set it.
# -*- coding: utf-8 -*-
# -------------------------------------------------------------
# Two-probe Configuration
# -------------------------------------------------------------

# -------------------------------------------------------------
# Left Electrode
# -------------------------------------------------------------

# Set up lattice
vector_a = [15.0, 0.0, 0.0]*Angstrom
vector_b = [9.18485099360515e-16, 15.0, 0.0]*Angstrom
vector_c = [0.0, 0.0, 7.0637512743]*Angstrom
left_electrode_lattice = UnitCell(vector_a, vector_b, vector_c)

# Define elements
left_electrode_elements = [Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold,
                           Gold]

# Define coordinates
left_electrode_coordinates = [[  7.1907375    ,   6.671025     ,   1.17729901125],
                              [ 10.0745025    ,   6.671025     ,   1.17729901125],
                              [  5.7488625    ,   9.168435     ,   1.17729901125],
                              [  8.6326275    ,   9.168435     ,   1.17729901125],
                              [  5.7488625    ,   7.503495     ,   3.5318775823 ],
                              [  8.6326125    ,   7.503495     ,   3.5318775823 ],
                              [  4.3069725    ,  10.000905     ,   3.5318775823 ],
                              [  7.1907375    ,  10.000905     ,   3.5318775823 ],
                              [  5.7488625    ,   5.838555     ,   5.88645226305],
                              [  8.6326125    ,   5.838555     ,   5.88645226305],
                              [  4.3069725    ,   8.335965     ,   5.88645226305],
                              [  7.1907375    ,   8.335965     ,   5.88645226305]]*Angstrom

# Set up configuration
left_electrode = BulkConfiguration(
    bravais_lattice=left_electrode_lattice,
    elements=left_electrode_elements,
    cartesian_coordinates=left_electrode_coordinates
    )

# -------------------------------------------------------------
# Right Electrode
# -------------------------------------------------------------

# Set up lattice
vector_a = [15.0, 0.0, 0.0]*Angstrom
vector_b = [9.18485099360515e-16, 15.0, 0.0]*Angstrom
vector_c = [0.0, 0.0, 7.063755164599996]*Angstrom
right_electrode_lattice = UnitCell(vector_a, vector_b, vector_c)

# Define elements
right_electrode_elements = [Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold,
                            Gold]

# Define coordinates
right_electrode_coordinates = [[  6.662341185865,   6.369654444235,   1.17729901125 ],
                               [  9.546091185865,   6.369654444235,   1.17729901125 ],
                               [  5.220451185865,   8.867064444235,   1.17729901125 ],
                               [  8.104216185865,   8.867064444235,   1.17729901125 ],
                               [  6.662341185865,   8.034594444235,   3.53185813085 ],
                               [  9.546091185865,   8.034594444235,   3.53185813085 ],
                               [  5.220451185865,  10.532004444235,   3.53185813085 ],
                               [  8.104216185865,  10.532004444235,   3.53185813085 ],
                               [  8.104216185865,   7.202124444235,   5.88645615335 ],
                               [ 10.987981185865,   7.202124444235,   5.88645615335 ],
                               [  6.662341185865,   9.699534444235,   5.88645615335 ],
                               [  9.546091185865,   9.699534444235,   5.88645615335 ]]*Angstrom

# Set up configuration
right_electrode = BulkConfiguration(
    bravais_lattice=right_electrode_lattice,
    elements=right_electrode_elements,
    cartesian_coordinates=right_electrode_coordinates
    )

# -------------------------------------------------------------
# Central Region
# -------------------------------------------------------------

# Set up lattice
vector_a = [15.0, 0.0, 0.0]*Angstrom
vector_b = [9.18485099360515e-16, 15.0, 0.0]*Angstrom
vector_c = [3.061616997868383e-15, 3.061616997868383e-15, 38.454696774010465]*Angstrom
central_region_lattice = UnitCell(vector_a, vector_b, vector_c)

# Define elements
central_region_elements = [Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold,
                           Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold,
                           Gold, Gold, Gold, Hydrogen, Carbon, Hydrogen, Carbon, Carbon,
                           Carbon, Carbon, Hydrogen, Carbon, Hydrogen, Hydrogen, Carbon,
                           Hydrogen, Nitrogen, Hydrogen, Hydrogen, Carbon, Hydrogen, Gold,
                           Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold,
                           Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold,
                           Gold, Gold]

# Define coordinates
central_region_coordinates = [[  7.1907375     ,   6.671025      ,   1.17729901125 ],
                              [ 10.0745025     ,   6.671025      ,   1.17729901125 ],
                              [  5.7488625     ,   9.168435      ,   1.17729901125 ],
                              [  8.6326275     ,   9.168435      ,   1.17729901125 ],
                              [  5.7488625     ,   7.503495      ,   3.5318775823  ],
                              [  8.6326125     ,   7.503495      ,   3.5318775823  ],
                              [  4.3069725     ,  10.000905      ,   3.5318775823  ],
                              [  7.1907375     ,  10.000905      ,   3.5318775823  ],
                              [  5.7488625     ,   5.838555      ,   5.88645226305 ],
                              [  8.6326125     ,   5.838555      ,   5.88645226305 ],
                              [  4.3069725     ,   8.335965      ,   5.88645226305 ],
                              [  7.1907375     ,   8.335965      ,   5.88645226305 ],
                              [  7.1907375     ,   6.671025      ,   8.24105028555 ],
                              [ 10.0745025     ,   6.671025      ,   8.24105028555 ],
                              [  5.7488625     ,   9.168435      ,   8.24105028555 ],
                              [  8.6326275     ,   9.168435      ,   8.24105028555 ],
                              [  5.7488625     ,   7.503495      ,  10.59560940515 ],
                              [  8.6326125     ,   7.503495      ,  10.59560940515 ],
                              [  4.3069725     ,  10.000905      ,  10.59560940515 ],
                              [  7.1907375     ,  10.000905      ,  10.59560940515 ],
                              [  5.7488625     ,   5.838555      ,  12.95016852475 ],
                              [  8.6326125     ,   5.838555      ,  12.95016852475 ],
                              [  4.3069725     ,   8.335965      ,  12.95016852475 ],
                              [  7.1907375     ,   8.335965      ,  12.95016852475 ],
                              [  7.1907375     ,   6.671025      ,  14.66018439715 ],
                              [  7.5971775     ,   9.163875      ,  16.53717151635 ],
                              [  7.6306125     ,   7.07118       ,  16.62544219645 ],
                              [  7.7716125     ,   4.999095      ,  17.08099515545 ],
                              [  7.7615325     ,   8.356965      ,  17.14323979545 ],
                              [  7.8641325     ,   5.945415      ,  17.45500763605 ],
                              [  8.1154275     ,   8.5434        ,  18.49390958055 ],
                              [  8.2241325     ,   6.14085       ,  18.80163151955 ],
                              [  8.1996375     ,   9.502425      ,  18.84049551665 ],
                              [  8.3453025     ,   7.43991       ,  19.35090156465 ],
                              [  8.3952975     ,   5.313585      ,  19.37848372075 ],
                              [ 10.6930275     ,   7.5312        ,  20.46784272655 ],
                              [  8.6974575     ,   7.629105      ,  20.78906397185 ],
                              [  8.7963525     ,   8.69124       ,  21.03131233015 ],
                              [ 10.0186125     ,   7.044675      ,  21.06297929075 ],
                              [  6.6569775     ,   7.51299       ,  21.56377632245 ],
                              [  7.5273975     ,   5.97462       ,  21.64905147925 ],
                              [  7.6306125     ,   7.056435      ,  21.75506188175 ],
                              [ 10.2633675     ,   7.272105      ,  22.02944403545 ],
                              [  8.104216185865,   7.202124444235,  23.79450848656 ],
                              [  6.662341185865,   6.369654444235,  25.50452435896 ],
                              [  9.546091185865,   6.369654444235,  25.50452435896 ],
                              [  5.220451185865,   8.867064444235,  25.50452435896 ],
                              [  8.104216185865,   8.867064444235,  25.50452435896 ],
                              [  6.662341185865,   8.034594444235,  27.85908347856 ],
                              [  9.546091185865,   8.034594444235,  27.85908347856 ],
                              [  5.220451185865,  10.532004444235,  27.85908347856 ],
                              [  8.104216185865,  10.532004444235,  27.85908347856 ],
                              [  8.104216185865,   7.202124444235,  30.21364259816 ],
                              [ 10.987981185865,   7.202124444235,  30.21364259816 ],
                              [  6.662341185865,   9.699534444235,  30.21364259816 ],
                              [  9.546091185865,   9.699534444235,  30.21364259816 ],
                              [  6.662341185865,   6.369654444235,  32.56824062066 ],
                              [  9.546091185865,   6.369654444235,  32.56824062066 ],
                              [  5.220451185865,   8.867064444235,  32.56824062066 ],
                              [  8.104216185865,   8.867064444235,  32.56824062066 ],
                              [  6.662341185865,   8.034594444235,  34.92279974026 ],
                              [  9.546091185865,   8.034594444235,  34.92279974026 ],
                              [  5.220451185865,  10.532004444235,  34.92279974026 ],
                              [  8.104216185865,  10.532004444235,  34.92279974026 ],
                              [  8.104216185865,   7.202124444235,  37.27739776276 ],
                              [ 10.987981185865,   7.202124444235,  37.27739776276 ],
                              [  6.662341185865,   9.699534444235,  37.27739776276 ],
                              [  9.546091185865,   9.699534444235,  37.27739776276 ]]*Angstrom

# Set up configuration
central_region = BulkConfiguration(
    bravais_lattice=central_region_lattice,
    elements=central_region_elements,
    cartesian_coordinates=central_region_coordinates
    )

device_configuration = DeviceConfiguration(
    central_region,
    [left_electrode, right_electrode],
    equivalent_electrode_lengths=[7.0637512743, 7.0637551646]*Angstrom,
    transverse_electrode_repetitions=[[1, 1], [1, 1]],
    )

# Add tags
device_configuration.addTags('Selection 0', [ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12,
                                             13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
                                             26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
                                             39, 40, 41, 42])
device_configuration.addTags('Selection 1', [43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
                                             56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67])

# -------------------------------------------------------------
# Calculator
# -------------------------------------------------------------
#----------------------------------------
# Basis Set
#----------------------------------------
HydrogenBasis = OpenMXBasisSet(
    element=PeriodicTable.Hydrogen,
    filename="openmx/pao/H5.0.pao.zip",
    atomic_species="s2p1",
    hubbard_u=[0.0, 0.0, 0.0]*eV,
    dft_half_parameters=Automatic,
    filling_method=SphericalSymmetric,
    onsite_spin_orbit_split=[0.0, 0.0, 0.0]*eV,
    pseudopotential=NormConservingPseudoPotential("normconserving/upf2/H_PBE13.upf.zip"),
    )

CarbonBasis = OpenMXBasisSet(
    element=PeriodicTable.Carbon,
    filename="openmx/pao/C6.0.pao.zip",
    atomic_species="s2p2d1",
    hubbard_u=[0.0, 0.0, 0.0, 0.0, 0.0]*eV,
    dft_half_parameters=Automatic,
    filling_method=SphericalSymmetric,
    onsite_spin_orbit_split=[0.0, 0.0, 0.0, 0.0, 0.0]*eV,
    pseudopotential=NormConservingPseudoPotential("normconserving/upf2/C_PBE13.upf.zip"),
    )

NitrogenBasis = OpenMXBasisSet(
    element=PeriodicTable.Nitrogen,
    filename="openmx/pao/N6.0.pao.zip",
    atomic_species="s2p2d1",
    hubbard_u=[0.0, 0.0, 0.0, 0.0, 0.0]*eV,
    dft_half_parameters=Automatic,
    filling_method=SphericalSymmetric,
    onsite_spin_orbit_split=[0.0, 0.0, 0.0, 0.0, 0.0]*eV,
    pseudopotential=NormConservingPseudoPotential("normconserving/upf2/N_PBE13.upf.zip"),
    )

basis_set = [
    HydrogenBasis,
    CarbonBasis,
    NitrogenBasis,
    BasisGGAPseudoDojoSO.Gold_Medium,
    ]

#----------------------------------------
# Exchange-Correlation
#----------------------------------------
exchange_correlation = SOGGA.PBE

#----------------------------------------
# Numerical Accuracy Settings
#----------------------------------------
device_k_point_sampling = MonkhorstPackGrid(
    nc=100,
    force_timereversal=False,
    )
device_numerical_accuracy_parameters = NumericalAccuracyParameters(
    k_point_sampling=device_k_point_sampling,
    exx_grid_cutoff=75.0*Hartree,
    density_mesh_cutoff=75.0*Hartree,
    )

#----------------------------------------
# Device Calculator
#----------------------------------------
calculator = DeviceLCAOCalculator(
    basis_set=basis_set,
    exchange_correlation=exchange_correlation,
    numerical_accuracy_parameters=device_numerical_accuracy_parameters,
    )

device_configuration.setCalculator(calculator)

# -------------------------------------------------------------
# Initial State
# -------------------------------------------------------------
scaled_spins = [
    (0, 1.0, 0.0*Degrees, 0.0*Degrees),
    (1, 1.0, 0.0*Degrees, 0.0*Degrees),
    (2, 1.0, 0.0*Degrees, 0.0*Degrees),
    (3, 1.0, 0.0*Degrees, 0.0*Degrees),
    (4, 1.0, 0.0*Degrees, 0.0*Degrees),
    (5, 1.0, 0.0*Degrees, 0.0*Degrees),
    (6, 1.0, 0.0*Degrees, 0.0*Degrees),
    (7, 1.0, 0.0*Degrees, 0.0*Degrees),
    (8, 1.0, 0.0*Degrees, 0.0*Degrees),
    (9, 1.0, 0.0*Degrees, 0.0*Degrees),
    (10, 1.0, 0.0*Degrees, 0.0*Degrees),
    (11, 1.0, 0.0*Degrees, 0.0*Degrees),
    (12, 1.0, 0.0*Degrees, 0.0*Degrees),
    (13, 1.0, 0.0*Degrees, 0.0*Degrees),
    (14, 1.0, 0.0*Degrees, 0.0*Degrees),
    (15, 1.0, 0.0*Degrees, 0.0*Degrees),
    (16, 1.0, 0.0*Degrees, 0.0*Degrees),
    (17, 1.0, 0.0*Degrees, 0.0*Degrees),
    (18, 1.0, 0.0*Degrees, 0.0*Degrees),
    (19, 1.0, 0.0*Degrees, 0.0*Degrees),
    (20, 1.0, 0.0*Degrees, 0.0*Degrees),
    (21, 1.0, 0.0*Degrees, 0.0*Degrees),
    (22, 1.0, 0.0*Degrees, 0.0*Degrees),
    (23, 1.0, 0.0*Degrees, 0.0*Degrees),
    (24, 1.0, 0.0*Degrees, 0.0*Degrees),
    (25, 0.0, 0.0*Degrees, 0.0*Degrees),
    (26, 0.0, 0.0*Degrees, 0.0*Degrees),
    (27, 0.0, 0.0*Degrees, 0.0*Degrees),
    (28, 0.0, 0.0*Degrees, 0.0*Degrees),
    (29, 0.0, 0.0*Degrees, 0.0*Degrees),
    (30, 0.0, 0.0*Degrees, 0.0*Degrees),
    (31, 0.0, 0.0*Degrees, 0.0*Degrees),
    (32, 0.0, 0.0*Degrees, 0.0*Degrees),
    (33, 0.0, 0.0*Degrees, 0.0*Degrees),
    (34, 0.0, 0.0*Degrees, 0.0*Degrees),
    (35, 0.0, 0.0*Degrees, 0.0*Degrees),
    (36, 0.0, 0.0*Degrees, 0.0*Degrees),
    (37, 0.0, 0.0*Degrees, 0.0*Degrees),
    (38, 0.0, 0.0*Degrees, 0.0*Degrees),
    (39, 0.0, 0.0*Degrees, 0.0*Degrees),
    (40, 0.0, 0.0*Degrees, 0.0*Degrees),
    (41, 0.0, 0.0*Degrees, 0.0*Degrees),
    (42, 0.0, 0.0*Degrees, 0.0*Degrees),
    (43, 1.0, 0.0*Degrees, 0.0*Degrees),
    (44, 1.0, 0.0*Degrees, 0.0*Degrees),
    (45, 1.0, 0.0*Degrees, 0.0*Degrees),
    (46, 1.0, 0.0*Degrees, 0.0*Degrees),
    (47, 1.0, 0.0*Degrees, 0.0*Degrees),
    (48, 1.0, 0.0*Degrees, 0.0*Degrees),
    (49, 1.0, 0.0*Degrees, 0.0*Degrees),
    (50, 1.0, 0.0*Degrees, 0.0*Degrees),
    (51, 1.0, 0.0*Degrees, 0.0*Degrees),
    (52, 1.0, 0.0*Degrees, 0.0*Degrees),
    (53, 1.0, 0.0*Degrees, 0.0*Degrees),
    (54, 1.0, 0.0*Degrees, 0.0*Degrees),
    (55, 1.0, 0.0*Degrees, 0.0*Degrees),
    (56, 1.0, 0.0*Degrees, 0.0*Degrees),
    (57, 1.0, 0.0*Degrees, 0.0*Degrees),
    (58, 1.0, 0.0*Degrees, 0.0*Degrees),
    (59, 1.0, 0.0*Degrees, 0.0*Degrees),
    (60, 1.0, 0.0*Degrees, 0.0*Degrees),
    (61, 1.0, 0.0*Degrees, 0.0*Degrees),
    (62, 1.0, 0.0*Degrees, 0.0*Degrees),
    (63, 1.0, 0.0*Degrees, 0.0*Degrees),
    (64, 1.0, 0.0*Degrees, 0.0*Degrees),
    (65, 1.0, 0.0*Degrees, 0.0*Degrees),
    (66, 1.0, 0.0*Degrees, 0.0*Degrees),
    (67, 1.0, 0.0*Degrees, 0.0*Degrees),
]
initial_spin = InitialSpin(scaled_spins=scaled_spins)

device_configuration.setCalculator(
    calculator,
    initial_spin=initial_spin,
)
device_configuration.update()
nlsave('iv-SOGGA-p-1.hdf5', device_configuration)
nlprint(device_configuration)

# -------------------------------------------------------------
# IV Curve
# -------------------------------------------------------------
biases = [0.000000, 0.200000, 0.400000, 0.600000, 0.800000, 1.000000,
          1.200000, 1.400000, 1.600000, 1.800000, 2.000000]*Volt

kpoint_grid = KpointDensity(
    density_a=2.38732414638*Angstrom,
    density_c=0.0*Angstrom,
    force_timereversal=False,
    )

iv_curve = IVCurve(
    configuration=device_configuration,
    biases=biases,
    energies=numpy.linspace(-2,2,101)*eV,
    kpoints=kpoint_grid,
    self_energy_calculator=RecursionSelfEnergy(),
    energy_zero_parameter=AverageFermiLevel,
    infinitesimal=1e-06*eV,
    selfconsistent_configurations_filename_prefix="ivcurve_selfconsistent_configuration_",
    log_filename_prefix="ivcurve_"
    )
nlsave('iv-SOGGA-p-1.hdf5', iv_curve)
nlprint(iv_curve)

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5589
  • Country: dk
  • Reputation: 102
    • View Profile
    • QuantumATK at Synopsys
I don't think you need a script, actually. If you open the IV curve in the GUI (NanoLab) you should be able to change the curves to show any spin component.