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.


Messages - tfpper

Pages: [1]
1
Hi, I'm trying to find the electrical optical properties silicene and put together the following code from the tutorials that I found (without any real understanding of the code, unfortunately).

When I tried to run in, it gave the following errors.

Code
Traceback (most recent call last):
  File "c:\users\davng\appdata\local\temp\9893607270215998.py", line 148, in <module>
    bands_above_fermi_level=All
  File ".\zipdir\NL\Analysis\Bandstructure.py", line 67, in __init__
  File ".\zipdir\NL\Analysis\BaseBandstructure.py", line 69, in __init__
  File ".\zipdir\NL\Analysis\BaseBandstructure.py", line 472, in setupPathMethod
  File ".\zipdir\NL\Analysis\BaseBandstructure.py", line 406, in determinePath
KeyError: 'X'

I wonder if anyone can help me with the code.
I suspect that the calculator settings for optimization and bandstructure calculation is not compatible.

Many thanks.

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

# Set up lattice
lattice = Hexagonal(3.5*Angstrom, 20.0*Angstrom)

# Define elements
elements = [Silicon, Silicon]

# Define coordinates
fractional_coordinates = [[ 0.45418381,  0.34262628,  0.49001735],
                          [ 0.60560144,  0.68985612,  0.50920254]]

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

# -------------------------------------------------------------
# Calculator
# -------------------------------------------------------------
#----------------------------------------
# Basis Set
#----------------------------------------
# Basis set for Silicon

silicon_3p = ConfinedOrbital(
    principal_quantum_number=3,
    angular_momentum=1,
    radial_cutoff_radius=6.83291378107*Bohr,
    confinement_start_radius=5.46633102486*Bohr,
    additional_charge=0,
    confinement_strength=14.6350449024*Hartree,
    confinement_power=1,
    radial_step_size=0.001*Bohr,
    )

silicon_3p_polarization = PolarizationOrbital(silicon_3p)

silicon_3p_split = AnalyticalSplit(silicon_3p, split_norm=0.15)

silicon_3s = ConfinedOrbital(
    principal_quantum_number=3,
    angular_momentum=0,
    radial_cutoff_radius=5.4002415094*Bohr,
    confinement_start_radius=4.32019320752*Bohr,
    additional_charge=0,
    confinement_strength=18.517690334*Hartree,
    confinement_power=1,
    radial_step_size=0.001*Bohr,
    )

silicon_3s_split = AnalyticalSplit(silicon_3s, split_norm=0.15)

SiliconBasis = BasisSet(
    element=PeriodicTable.Silicon,
    orbitals=[ silicon_3s , silicon_3p , silicon_3s_split , silicon_3p_split , silicon_3p_polarization ],
    occupations=[ 2.0 , 2.0 , 0.0 , 0.0 , 0.0],
    hubbard_u=[ 0.0 , 0.0 , 0.0 , 0.0 , 0.0]*eV,
    filling_method=SphericalSymmetric,
    pseudopotential=NormConservingPseudoPotential("normconserving/SI.LDAPZ.zip"),
    )

basis_set = [
    SiliconBasis,
    ]

#----------------------------------------
# Exchange-Correlation
#----------------------------------------
exchange_correlation = LDA.PZ

numerical_accuracy_parameters = NumericalAccuracyParameters(
    interaction_max_range=10.0*Angstrom,
    electron_temperature=300.0*Kelvin,
    reciprocal_energy_cutoff=1250.0*Hartree,
    number_of_reciprocal_points=1024,
    radial_step_size=0.001*Bohr,
    density_cutoff=1e-06,
    k_point_sampling=(1, 1, 1),
    density_mesh_cutoff=75.0*Hartree,
    )

iteration_control_parameters = IterationControlParameters(
    damping_factor=0.1,
    linear_dependence_threshold=0.0,
    algorithm=PulayMixer(),
    preconditioner=Preconditioner.Off,
    start_mixing_after_step=0,
    number_of_history_steps=20,
    max_steps=100,
    tolerance=0.0001,
    mixing_variable=HamiltonianVariable,
    )

poisson_solver = FastFourierSolver()

dynamical_matrix_parameters = DynamicalMatrixParameters(
    atomic_displacement=0.01*Angstrom,
    repeats=Automatic,
    )

calculator = LCAOCalculator(
    basis_set=basis_set,
    exchange_correlation=exchange_correlation,
    numerical_accuracy_parameters=numerical_accuracy_parameters,
    iteration_control_parameters=iteration_control_parameters,
    poisson_solver=poisson_solver,
    dynamical_matrix_parameters=dynamical_matrix_parameters,
    charge=0.0,
    )

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

bulk_configuration = OptimizeGeometry(
        bulk_configuration,
        max_forces=0.05*eV/Ang,
        max_steps=200,
        max_step_length=0.5*Ang,
        trajectory_filename=None,
        disable_stress=True,
        optimizer_method=QuasiNewton(),
        )
nlsave('silicene.nc', bulk_configuration)
nlprint(bulk_configuration)





# -------------------------------------------------------------
# Bandstructure
# -------------------------------------------------------------
bandstructure = Bandstructure(
    configuration=bulk_configuration,
    route=['G', 'X', 'W', 'L', 'G', 'K', 'X', 'U', 'W', 'K', 'L'],
    points_per_segment=20,
    bands_above_fermi_level=All
    )
nlsave('silicene.nc', bandstructure)

# -------------------------------------------------------------
# Density of states
# -------------------------------------------------------------
density_of_states = DensityOfStates(
    configuration=bulk_configuration,
    kpoints=MonkhorstPackGrid(15,15,15),
    energy_zero_parameter=FermiLevel,
    bands_above_fermi_level=None,
    )
nlsave('silicene.nc', density_of_states)
nlprint(density_of_states)

# -------------------------------------------------------------
# Optical spectrum
# -------------------------------------------------------------
optical_spectrum = OpticalSpectrum(
    configuration=bulk_configuration,
    kpoints=MonkhorstPackGrid(15,15,15),
    energies=numpy.linspace(0,5,101)*eV,
    broadening=0.1*eV,
    bands_below_fermi_level=10,
    bands_above_fermi_level=20,
    )
nlsave('silicene.nc', optical_spectrum)

# Get the energies range
energies = spectrum.energies()

# get the real and imaginary part of the e_xx component of the dielectric tensor
d_r = spectrum.evaluateDielectricConstant()[0,0,:]
d_i = spectrum.evaluateImaginaryDielectricConstant()[0,0,:]

# Calculate the wavelength
l = (speed_of_light*planck_constant/energies).inUnitsOf(nanoMeter)

# Calculate real and complex part of the refractive index
n  = numpy.sqrt(0.5*(numpy.sqrt(d_r**2+d_i**2)+d_r))
k =  numpy.sqrt(0.5*(numpy.sqrt(d_r**2+d_i**2)-d_r))

# Calculate the adsorption coefficient
alpha = (2*energies/hbar/speed_of_light*k).inUnitsOf(nanoMeter**-1)

# Plot the data
import pylab
pylab.figure()
pylab.subplots_adjust(hspace=0.0)
ax = pylab.subplot(211)
ax.plot(l,n,'b', label='refractive index')
ax.axis([180,1000,2.2,6.4])
ax.set_ylabel(r"$n$", size=16)
ax.tick_params(axis='x', labelbottom=False, labeltop=True)
ax = pylab.subplot(212)
ax.plot(l,alpha,'r')
ax.axis([180,1000,0,0.24])
ax.set_xlabel(r"$\lambda$ (nm)", size=16)
ax.set_ylabel(r"$\alpha$ (1/nm)",size=16)
pylab.show()

nlsave('silicene.nc', OpticalSpectrum)

2
OK. I got this from another ATK tutorial. Do you mean to add this code into the script. What is the default k_point_sampling?
Also, as a test calculation, what is a good sample size in the case of a nanosheet?

Code
numerical_accuracy_parameters = NumericalAccuracyParameters(
    k_point_sampling=(9, 9, 1),
    )

calculator = LCAOCalculator(
    numerical_accuracy_parameters=numerical_accuracy_parameters,
    )

3
What is the best way to optimise the geometry of a nanosheet of Si atom.
From the tutorial, I've got the following.
Should I use the default ATK-DFT or ATK-Extended Hückel?

Code
calculator = LCAOCalculator()

bulk_configuration.setCalculator(calculator)
nlprint(bulk_configuration)
bulk_configuration.update()
nlsave('C:/Users/davng/ATK/Silicene/SiliceneSheet10_0_10_Buckle2_OptGeom.nc', bulk_configuration)


bulk_configuration = OptimizeGeometry(
        bulk_configuration,
        max_forces=0.05*eV/Ang,
        max_steps=200,
        max_step_length=0.5*Ang,
        trajectory_filename='C:/Users/davng/ATK/Silicene/SiliceneSheet10_0_10_Buckle2_OptGeom_traj.nc',
        disable_stress=True,
        optimizer_method=QuasiNewton(),
        )
nlsave('C:/Users/davng/ATK/Silicene/SiliceneSheet10_0_10_Buckle2_OptGeom.nc', bulk_configuration)
nlprint(bulk_configuration)

4
I've twice had this problem.

I am running atkpython on my local PC connecting to a LAN license server.
After several days of computation I got this error message

Quote
Connection to server [ atk.license.eng.unimelb.edu.au : 6200 ] lost - trying to reconnect.
Server could not re-checkout feature because:
Unable to read file

I noticed that on both times, the checkpoint file reached a size of 57,715 kb.

I've asked the network administrator to trouble shoot the problem the first time and the license server log file says
Quote
[2012-09-27 09:51:58] USER INACTIVE davng@400D-97989
All other lines say STATUS, CHECKIN or CHECKOUT


5
General Questions and Answers / Re: Running atkpython without VNL
« on: September 21, 2012, 02:37 »
Thanks for your quick reply.
Notepad++ is a great editor. I'm monitoring the log file using it now.

6
General Questions and Answers / Running atkpython without VNL
« on: September 20, 2012, 05:12 »
Hi,

I am running atkpython in Windows using the command.

> atkypthon myscript.py > logfile.log

However, it seems that the logfile.log does not get updated until the job has finished.
Is there a way to update logfile.log at regular intervals as I would like to see the progress as the calculation may take a while.

I can see the log file (being updated as calculation progresses) when I launch the job using vnl. But I want to avoid this as there are other users who might want to use the vnl license.

Thanks.

Pages: [1]