Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - fly

Pages: [1]
1
General Questions and Answers / SGGA+U and Van der Waals correction
« on: September 26, 2018, 12:47 »
Hi
I'm working on the band structures of bilayer CrI3 using QuantumATK 2016.  After I Choose SGGA+U, why is Van der Waals
correction automatically closed?  Can SGGA+U and Van der Waals  correction be set at the same time?

2
General Questions and Answers / modification of script
« on: April 24, 2012, 11:43 »
I have calculated a system using ATK2008-10. We can obtain the PDOS using the script below. But if the K-point sampling in x and y directions is 3*3. How do I modify this script?

from ATK.TwoProbe import *; import numpy
from projected_density_of_states import *


scf = restoreSelfConsistentCalculation('lih2li.nc')

projection_atoms = [5,6]
pdos = calculateProjectedDensityOfStates(scf,numpy.arange(-3,3.01,0.01)*Units.eV,
                                         projection_atoms = projection_atoms)

nlPrint(pdos)


from ATK.TwoProbe import *; import numpy as np

def calculateProjectedDensityOfStates(self_consistent_calculation = None,
                                      energies = None,
                                      brillouin_zone_integration_parameters = None,
                                      green_function_infinitesimal = None,
                                      projection_atoms = []):
    """
    Written by Nordland !
    Extreme usage of ATK backengine!

    Module for calculate the density of states projected onto the atoms.

    Uses the same interfaces as calculateDensityOfStates, but is extended with a parameter
    called projection_atoms.
   
    Give the projection atoms as a sequence of the indicies of the atoms to project onto
    for instance projection_atoms = [3,6,7,8]
    """
    atom_container = self_consistent_calculation._attributeContainer().getAtomContainer("AtomContainer")
    number_of_atoms = atom_container.numberOfAtoms()
    old_contact = [(atom_container.atoms()).isContact() for i in range(number_of_atoms)]
    first_atom_index = \
            np.where([ not(atom_container.atoms()).isElectrode() for i in range(number_of_atoms)])[0][0]
    new_contact = np.array([False]*number_of_atoms)
    indicies = np.array(projection_atoms)+first_atom_index
    new_contact[indicies] = True

    # Insert the new contact atoms.
    for i,c in enumerate(new_contact):
        (atom_container.atoms()).setContact(bool(c))
    pdos = calculateDensityOfStates(self_consistent_calculation,
                                    energies,
                                    brillouin_zone_integration_parameters,
                                    green_function_infinitesimal)
    # Restore the old contact atoms.
    for i,c in enumerate(old_contact):
        (atom_container.atoms()).setContact(bool(c))
    # Return the projected density of states.
    return pdos

3
If I execute an ab initio molecular dynamics simulation on 6-ZGNR
at room temperature (T=300 K) with a time step of 1 fs. Is it right for the following script? Do I need to make some revisions for some parameters in the following scrip? Who can provide the corresponding tutorial for molecular dynamics simulation in ATK 11.8. Thanks!


# -------------------------------------------------------------
# Bulk configuration
# -------------------------------------------------------------

# Set up lattice
vector_a = [10.0, 0.0, 0.0]*Angstrom
vector_b = [0.0, 23.56888, 0.0]*Angstrom
vector_c = [0.0, 0.0, 2.46100171044]*Angstrom
lattice = UnitCell(vector_a, vector_b, vector_c)

# Define elements
elements = [Carbon, Carbon, Carbon, Carbon, Carbon, Carbon, Carbon, Carbon,
            Carbon, Carbon, Carbon, Carbon, Hydrogen, Hydrogen]

# Define coordinates
cartesian_coordinates = [[  5.        ,  17.46788   ,   0.        ],
                         [  5.        ,   6.101     ,   0.        ],
                         [  5.        ,   6.81143   ,   1.23050086],
                         [  5.        ,   8.23229   ,   1.23050086],
                         [  5.        ,   8.94272   ,   0.        ],
                         [  5.        ,  10.36358   ,   0.        ],
                         [  5.        ,  11.07401   ,   1.23050086],
                         [  5.        ,  12.49487   ,   1.23050086],
                         [  5.        ,  13.2053    ,   0.        ],
                         [  5.        ,  14.62616   ,   0.        ],
                         [  5.        ,  15.33659   ,   1.23050086],
                         [  5.        ,  16.75745   ,   1.23050086],
                         [  5.        ,  18.56888   ,   0.        ],
                         [  5.        ,   5.        ,   0.        ]]*Angstrom

# Set up configuration
bulk_configuration = BulkConfiguration(
    bravais_lattice=lattice,
    elements=elements,
    cartesian_coordinates=cartesian_coordinates
    )

# -------------------------------------------------------------
# Calculator
# -------------------------------------------------------------
numerical_accuracy_parameters = NumericalAccuracyParameters(
    grid_mesh_cutoff=150.0*Hartree,
    k_point_sampling=(1, 1, 100),
    )

iteration_control_parameters = IterationControlParameters(
    tolerance=1e-05,
    )

calculator = LCAOCalculator(
    numerical_accuracy_parameters=numerical_accuracy_parameters,
    iteration_control_parameters=iteration_control_parameters,
    )

bulk_configuration.setCalculator(calculator)
nlprint(bulk_configuration)
bulk_configuration.update()
nlsave('analysis.nc', bulk_configuration)

initial_velocity = None
method = VelocityVerlet(
        time_step=1.0*femtoSecond,
        initial_velocity=initial_velocity
    )
molecular_dynamics = MolecularDynamics(
        bulk_configuration,
        constraints=[],
        log_filename='trajectory.nc',
        steps=1000,
        log_interval=1,
        method=method
    )
nlsave('analysis.nc', molecular_dynamics)
nlprint(molecular_dynamics)

4
General Questions and Answers / smearing width for DOS
« on: February 19, 2012, 10:20 »
When we plot DOS, is it possible to set smearing width in ATK 11.8.2?

5
If the geometry of 4-ZGNR is optimized until all residual forces on each atom are smaller than 0.05 eV/angstrom , what is the physical meaning for 0.05 eV/angstrom , and What is the corresponding energy convergence per atom?  The configuration of 4-ZGNR is obtained using following manuscript. I have carefully read ATK manual, but I cannot find corresponding information for this question. Who can help me?

armchair = False   # False -> zigzag
width = 8          # ribbon width across, number of layers (must be even for zigzag)
repetitions = 1    # repetitions of the minimal unit along the ribbon
PAC = True         # False -> molecule

# C-C and C-H and unit cell padding distances (all in Angstrom)
aCC = 1.42086
aCH = 1.101
cell_pad = 30.

'''===========================================================================
Nothing needs to be modified below this line!
==========================================================================='''

from ATK.KohnSham import *
from numpy import array, fromfunction
import math

# -------------------------------------------------------------------------------------------
# Positions are in units of aCC until the very end!
# -------------------------------------------------------------------------------------------

def unit_cell_C_atoms (zigzag,layers):
   
    zpos = []
    xpos = []
    zigzag_zpos = [0.0,0.5,0.5,0.0]
    zigzag_xpos = [0.0,0.5,1.5,2.0]
    for x in range(0,layers):
        if zigzag:
            zpos += [zigzag_zpos[x%4] * math.sqrt(3.)]
            xpos += [zigzag_xpos[x%4] + 3.*(x//4)]
        else:
            zpos += [0.5+1.5*(x%2), 1.5-1.5*(x%2)]
            xpos += [x*math.sqrt(3.)/2.,]*2
    return (xpos,zpos)

def unit_cell_H_atoms (zigzag,layers,xpos,zpos,xCH,zCH):

    if zigzag:
        hydrogen_z = [0., 0.5*math.sqrt(3.)*((width/2)%2)]
        hydrogen_x = [xpos[0]-xCH, xpos[-1]+xCH]
    else:
        hydrogen_z = [zpos[0]-zCH, zpos[1]+zCH, zpos[-2]-zCH, zpos[-1]+zCH]
        hydrogen_x = [xpos[0]-xCH, xpos[0]-xCH, xpos[-1]+xCH, xpos[-1]+xCH]
    return (hydrogen_x,hydrogen_z)

# -----------------------------------------------------------------------

zigzag = not armchair

if (zigzag and (width%2==1)):
    raise ValueError, "Width must be an even number for zigzag"

pad = cell_pad/aCC

# For zigzag, the unit cell in Z is sqrt(3)*aCC, for armchair 3*aCC
if zigzag:
    atoms_per_cell = width + 2
    period_z = math.sqrt(3.)
    xCH = aCH/aCC
    zCH = 0.
    elements = ([Carbon,]*width+[Hydrogen,]*2)*repetitions
else:
    atoms_per_cell = width*2 + 4
    period_z = 3.
    xCH = aCH/aCC*math.sqrt(3.)/2.
    zCH = aCH/aCC/2.
    elements = ([Carbon,]*2*width+[Hydrogen,]*4)*repetitions

# -----------------------------------------------------------------------

# Set up the unit cell along the ribbon
(xpos,zpos) = unit_cell_C_atoms (zigzag,width)
(h_xpos,h_zpos) = unit_cell_H_atoms (zigzag,width,xpos,zpos,xCH,zCH)

# Merge C and H, and repeat desired times along ribbon length (Z)
xpos = array((xpos + h_xpos)*repetitions)
zpos = array((zpos + h_zpos)*repetitions)

# The coordinates in zpos must still be shifted along z by N*unit cell width where N=0,1,2,3,...,repetitions-1
# This part is not needed if we would do all repetitions in VNL
shift = fromfunction( lambda i,j : j//atoms_per_cell, (1,atoms_per_cell*repetitions) )
zpos = zpos + shift[0] * period_z

# Unit cell
# In x, add the desired padding the the distance between the outermost atoms
# In y, use the desired padding
# In z, the period is given by period_z, we just need to scale it properly
unit_x = (max(xpos)-min(xpos)) + pad
unit_y = pad
unit_z = period_z * repetitions
unit_cell = array([ [unit_x, 0., 0. ],
                    [0., unit_y, 0. ],
                    [0., 0., unit_z ] ])
             
# Center the atoms in the unit cell
# For x, first adjust for position of H atom, then shift by half the padding
xpos += xCH + pad/2.
# z shift is half
if zigzag:
    zpos += period_z / 4.
else:
    zpos += period_z / 6.   
# And finally y
ypos = array([0.] * repetitions * atoms_per_cell) + pad/2.
   
# Merge coordinates to xyz
pos = array([xpos,ypos,zpos]).transpose()

# Apply final scaling by aCC * Angstrom
# Note: If PACs can be dropped on Molecular Builder, we can do PAC=True permanently
if PAC:
    graphene_ribbon = PeriodicAtomConfiguration (unit_cell*aCC*Ang, elements, pos*aCC*Ang)
else:
    graphene_ribbon_as_molecule = MoleculeConfiguration (elements,pos*aCC*Ang)

6
General Questions and Answers / Co or Ni electrode
« on: May 8, 2011, 13:39 »
I want to set a two-probe syetem using Co or Ni electrode. If the intial spin for Co (Ni) atoms is set as 1. Is it right?

7
Recently, I try to use atk-11.2.0.  However, when I test spin-polarized ZGNR, I cannot get the
spin up and spin down bands.  In vnl, I can only find a band picture. The band is the same with spin unpolarized band whatever the intial spin is set AF or FM. Why is this? I have tested other systems, same case is presented. The script is posted as follows:
# -------------------------------------------------------------
# Bulk configuration
# -------------------------------------------------------------

# Set up lattice
vector_a = [10.0, 0.0, 0.0]*Angstrom
vector_b = [0.0, 19.3063, 0.0]*Angstrom
vector_c = [0.0, 0.0, 2.46100171044]*Angstrom
lattice = UnitCell(vector_a, vector_b, vector_c)

# Define elements
elements = [Carbon, Carbon, Carbon, Carbon, Carbon, Carbon, Carbon, Carbon,
            Hydrogen, Hydrogen]

# Define coordinates
cartesian_coordinates = [[  5.        ,  13.2053    ,   0.        ],
                         [  5.        ,   6.101     ,   0.        ],
                         [  5.        ,   6.81143   ,   1.23050086],
                         [  5.        ,   8.23229   ,   1.23050086],
                         [  5.        ,   8.94272   ,   0.        ],
                         [  5.        ,  10.36358   ,   0.        ],
                         [  5.        ,  11.07401   ,   1.23050086],
                         [  5.        ,  12.49487   ,   1.23050086],
                         [  5.        ,  14.3063    ,   0.        ],
                         [  5.        ,   5.        ,   0.        ]]*Angstrom

# Set up configuration
bulk_configuration = BulkConfiguration(
    bravais_lattice=lattice,
    elements=elements,
    cartesian_coordinates=cartesian_coordinates
    )

# -------------------------------------------------------------
# Calculator
# -------------------------------------------------------------
#----------------------------------------
# Basis Set
#----------------------------------------
basis_set = LDABasis.SingleZetaPolarized

numerical_accuracy_parameters = NumericalAccuracyParameters(
    grid_mesh_cutoff=150.0*Hartree,
    )

calculator = LCAOCalculator(
    basis_set=basis_set,
    numerical_accuracy_parameters=numerical_accuracy_parameters,
    )

bulk_configuration.setCalculator(calculator)

# -------------------------------------------------------------
# Initial State
# -------------------------------------------------------------
initial_spin = InitialSpin(scaled_spins=[1.0, -1.0, -1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0])
bulk_configuration.setCalculator(
    calculator,
    initial_spin=initial_spin,
)
bulk_configuration.update()
nlsave('analysis.nc', bulk_configuration)
nlprint(bulk_configuration)

# -------------------------------------------------------------
# Bandstructure
# -------------------------------------------------------------
bandstructure = Bandstructure(
    configuration=bulk_configuration,
    route=['G', 'Z'],
    points_per_segment=20,
    bands_above_fermi_level=All
    )
nlsave('analysis.nc', bandstructure)

8
APPLIED PHYSICS LETTERS 97, 043115 (2010). In this article, the author demonstrate that hybrid BN–C
nanotubes (BN-CNTs) have diverse electronic and magnetic properties. It is konwn that  the ferromagnetic, anti-ferromagnetic, or ferrimagnetic states must be considered for graphene nanoribbon. But, how can we set the value of " initial_scaled_spin"  in this configure. Who can give me some tips?

9
I am eager to get the script for exporting Force constants matrix after geometry optimization. who can help me?
 ??? :'(

10
General Questions and Answers / Is the sc2 reasonable?
« on: April 9, 2009, 11:27 »
I calculated the current of a system under bias 1.0v ,I found sc2 is  obviously diffrent from the others?Is the sc2 and current reasonable?

# TwoProbe Calculation
# ----------------------------------------------------------------
# sc  0 : q =  480.00000 e
# sc  1 : q =  542.95514 e  dRho = 1.9428E+000
# sc  2 : q =  137.00538 e  dRho = 2.6086E+000
# sc  3 : q =  499.90052 e  dRho = 1.5195E+000
# sc  4 : q =  494.12688 e  dRho = 5.2405E-001
# sc  5 : q =  487.74270 e  dRho = 3.9395E-001
# sc  6 : q =  481.76524 e  dRho = 3.5181E-001
# sc  7 : q =  486.57967 e  dRho = 5.0695E-001
# sc  8 : q =  486.03414 e  dRho = 9.6848E-002
# sc  9 : q =  482.53931 e  dRho = 2.3964E-001
# sc 10 : q =  487.40306 e  dRho = 2.5438E-001
# sc 11 : q =  483.19251 e  dRho = 1.6260E-001
# sc 12 : q =  484.78357 e  dRho = 7.8402E-002
# sc 13 : q =  484.95686 e  dRho = 7.4214E-002
# sc 14 : q =  484.38713 e  dRho = 5.7788E-002
# sc 15 : q =  484.82255 e  dRho = 2.3814E-002
# sc 16 : q =  484.56822 e  dRho = 1.5125E-002
# sc 17 : q =  484.61513 e  dRho = 6.7451E-003
# sc 18 : q =  484.61671 e  Etot = -1525.69294 Ry  dRho = 4.2121E-003
# sc 19 : q =  484.59442 e  Etot = -1525.68591 Ry  dRho = 2.9226E-003  dEtot = 7.0290E-003 Ry
# sc 20 : q =  484.58401 e  Etot = -1525.68434 Ry  dRho = 9.1391E-004  dEtot = 1.5712E-003 Ry
# sc 21 : q =  484.57112 e  Etot = -1525.68072 Ry  dRho = 8.5794E-004  dEtot = 3.6167E-003 Ry
# sc 22 : q =  484.57337 e  Etot = -1525.68224 Ry  dRho = 4.0889E-004  dEtot = -1.5224E-003 Ry
# sc 23 : q =  484.57343 e  Etot = -1525.68308 Ry  dRho = 2.8450E-004  dEtot = -8.4266E-004 Ry
# sc 24 : q =  484.57499 e  Etot = -1525.68385 Ry  dRho = 2.2029E-004  dEtot = -7.6202E-004 Ry
# sc 25 : q =  484.57662 e  Etot = -1525.68419 Ry  dRho = 1.3115E-004  dEtot = -3.4490E-004 Ry
# sc 26 : q =  484.57561 e  Etot = -1525.68363 Ry  dRho = 1.6962E-004  dEtot = 5.6395E-004 Ry
# sc 27 : q =  484.57762 e  Etot = -1525.68396 Ry  dRho = 1.6974E-004  dEtot = -3.3156E-004 Ry
# sc 28 : q =  484.57861 e  Etot = -1525.68402 Ry  dRho = 1.2147E-004  dEtot = -6.1062E-005 Ry
# sc 29 : q =  484.57866 e  Etot = -1525.68372 Ry  dRho = 1.9630E-004  dEtot = 2.9448E-004 Ry
# sc 30 : q =  484.58133 e  Etot = -1525.68289 Ry  dRho = 2.0628E-004  dEtot = 8.3346E-004 Ry
# sc 31 : q =  484.58184 e  Etot = -1525.68264 Ry  dRho = 5.8201E-005  dEtot = 2.4807E-004 Ry
# sc 32 : q =  484.58188 e  Etot = -1525.68252 Ry  dRho = 3.1143E-005  dEtot = 1.2384E-004 Ry
# sc 33 : q =  484.58145 e  Etot = -1525.68228 Ry  dRho = 2.6188E-005  dEtot = 2.4093E-004 Ry
# sc 34 : q =  484.58144 e  Etot = -1525.68221 Ry  dRho = 1.1036E-005  dEtot = 6.7659E-005 Ry
# sc 35 : q =  484.58176 e  Etot = -1525.68222 Ry  dRho = 2.4597E-005  dEtot = -7.1825E-006 Ry
1.83937763181e-011 A

Pages: [1]