Author Topic: self-consistent  (Read 4492 times)

0 Members and 1 Guest are viewing this topic.

Offline qnsyhanjiu

  • Heavy QuantumATK user
  • ***
  • Posts: 33
  • Reputation: 0
    • View Profile
self-consistent
« on: April 7, 2011, 08:08 »
# Total Charge (Spin Down) =  767.00537
#-------------------------------------------------------------------------------
# sc 20 : Fermi Energy =   -0.20291 Ry  dRho =  1.3457E-02
#-------------------------------------------------------------------------------
# Mulliken Population for sc 20
#-------------------------------------------------------------------------------
# Spin Up
I computer the self-consistent,when the result is Mulliken Population for sc 20,the result is stop,but top,the computer is still running why? Thank you!

Offline qnsyhanjiu

  • Heavy QuantumATK user
  • ***
  • Posts: 33
  • Reputation: 0
    • View Profile
Re: self-consistent
« Reply #1 on: April 7, 2011, 08:16 »
This is my scripter:


from ATK.TwoProbe import *
from ATK.MPI import processIsMaster

# Generate time stamp
if processIsMaster():
    import platform, time
    print '#',time.ctime()
    print '#',platform.node(),platform.platform()+'\n'

# Scattering elements and coordinates
scattering_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,     Gold,     Gold,     Gold,     
                       Gold,     Gold,     Gold,     Gold,     
                       Carbon,   Carbon,   Carbon,   Carbon,   
                       Carbon,   Carbon,   Carbon,   Carbon,   
                       Hydrogen, Hydrogen, Hydrogen, Hydrogen,
                       Hydrogen, Hydrogen, Hydrogen, Hydrogen,
                       Iron,     Carbon,   Carbon,   Carbon,   
                       Carbon,   Carbon,   Carbon,   Carbon,   
                       Carbon,   Hydrogen, Hydrogen, Hydrogen,
                       Hydrogen, Hydrogen, Hydrogen, Hydrogen,
                       Hydrogen, Iron,     Carbon,   Carbon,   
                       Carbon,   Carbon,   Carbon,   Carbon,   
                       Carbon,   Carbon,   Hydrogen, Hydrogen,
                       Hydrogen, Hydrogen, Hydrogen, Hydrogen,
                       Hydrogen, 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,     Gold,     
                       Gold,     Gold,     Gold,     Gold,     
                       Gold,     Gold]
scattering_coordinates = [[  0.        ,   0.        ,   4.07800007],
                          [  0.        ,   2.8835814 ,   4.07800007],
                          [  0.        ,   5.7671628 ,   4.07800007],
                          [  0.        ,   8.65074444,   4.07800007],
                          [  2.8835814 ,   0.        ,   4.07800007],
                          [  2.8835814 ,   2.8835814 ,   4.07800007],
                          [  2.8835814 ,   5.7671628 ,   4.07800007],
                          [  2.8835814 ,   8.65074444,   4.07800007],
                          [  5.7671628 ,   0.        ,   4.07800007],
                          [  5.7671628 ,   2.8835814 ,   4.07800007],
                          [  5.7671628 ,   5.7671628 ,   4.07800007],
                          [  5.7671628 ,   8.65074444,   4.07800007],
                          [  8.65074444,   0.        ,   4.07800007],
                          [  8.65074444,   2.8835814 ,   4.07800007],
                          [  8.65074444,   5.7671628 ,   4.07800007],
                          [  8.65074444,   8.65074444,   4.07800007],
                          [  1.4417907 ,   1.4417907 ,   6.1170001 ],
                          [  1.4417907 ,   4.32537222,   6.1170001 ],
                          [  1.4417907 ,   7.20895386,   6.1170001 ],
                          [  1.4417907 ,  10.09253502,   6.1170001 ],
                          [  4.32537222,   1.4417907 ,   6.1170001 ],
                          [  4.32537222,   4.32537222,   6.1170001 ],
                          [  4.32537222,   7.20895386,   6.1170001 ],
                          [  4.32537222,  10.09253502,   6.1170001 ],
                          [  7.20895386,   1.4417907 ,   6.1170001 ],
                          [  7.20895386,   4.32537222,   6.1170001 ],
                          [  7.20895386,   7.20895386,   6.1170001 ],
                          [  7.20895386,  10.09253502,   6.1170001 ],
                          [ 10.09253502,   1.4417907 ,   6.1170001 ],
                          [ 10.09253502,   4.32537222,   6.1170001 ],
                          [ 10.09253502,   7.20895386,   6.1170001 ],
                          [ 10.09253502,  10.09253502,   6.1170001 ],
                          [  3.02664982,   5.03114932,  11.19394743],
                          [  3.64980839,   3.62328051,  11.19235987],
                          [  5.08596092,   3.06840383,  11.19343848],
                          [  6.49382888,   3.69155847,  11.19655144],
                          [  7.04870211,   5.1277089 ,  11.1998752 ],
                          [  6.42554365,   6.53557764,  11.20146275],
                          [  4.98939115,   7.09045445,  11.20038415],
                          [  3.58152317,   6.46729969,  11.19727121],
                          [  1.89673768,   5.00402291,  11.19228215],
                          [  2.87002312,   2.80513106,  11.18980259],
                          [  5.11309019,   1.93849217,  11.19148725],
                          [  7.31198059,   2.91177164,  11.19634923],
                          [  8.17861425,   5.15483531,  11.20154048],
                          [  7.20532905,   7.35372721,  11.20402003],
                          [  4.96226188,   8.22036587,  11.2023354 ],
                          [  2.76337134,   7.24708663,  11.1974734 ],
                          [  5.03538535,   5.07661079,  12.79707573],
                          [  3.02206932,   5.02551366,  14.39372049],
                          [  3.64522778,   3.61764489,  14.39213286],
                          [  5.08138034,   3.06276821,  14.39321146],
                          [  6.48924826,   3.68592285,  14.39632449],
                          [  7.04412161,   5.12207324,  14.39964829],
                          [  6.42096316,   6.52994202,  14.40123592],
                          [  4.98481057,   7.08481871,  14.40015731],
                          [  3.57694267,   6.46166407,  14.39704428],
                          [  1.89215718,   4.99838725,  14.39205513],
                          [  2.86544262,   2.79949556,  14.38957558],
                          [  5.10850961,   1.93285667,  14.39126024],
                          [  7.30740009,   2.9061359 ,  14.39612231],
                          [  8.17403375,   5.14919965,  14.40131364],
                          [  7.20074831,   7.34809147,  14.40379319],
                          [  4.9576813 ,   8.21473037,  14.40210853],
                          [  2.75879084,   7.24145089,  14.39724646],
                          [  5.03080556,   5.07097611,  15.99629293],
                          [  3.01748859,   5.019878  ,  17.5934938 ],
                          [  3.64064716,   3.61200927,  17.59190593],
                          [  5.07679976,   3.05713259,  17.59298454],
                          [  6.48466765,   3.68028723,  17.59609733],
                          [  7.03954099,   5.11643758,  17.59942136],
                          [  6.41638254,   6.52430628,  17.60100875],
                          [  4.98022999,   7.07918297,  17.59993015],
                          [  3.57236205,   6.45602845,  17.59681735],
                          [  1.88757645,   4.9927516 ,  17.59182821],
                          [  2.86086188,   2.79385983,  17.58934865],
                          [  5.10392903,   1.92722093,  17.59103332],
                          [  7.3028196 ,   2.90050017,  17.59589515],
                          [  8.16945325,   5.14356399,  17.60108648],
                          [  7.19616781,   7.34245573,  17.60356603],
                          [  4.95310072,   8.20909463,  17.60188136],
                          [  2.75421034,   7.23581539,  17.59701953],
                          [  0.        ,   0.        ,  22.67700092],
                          [  0.        ,   2.8835814 ,  22.67700092],
                          [  0.        ,   5.7671628 ,  22.67700092],
                          [  0.        ,   8.65074444,  22.67700092],
                          [  2.8835814 ,   0.        ,  22.67700092],
                          [  2.8835814 ,   2.8835814 ,  22.67700092],
                          [  2.8835814 ,   5.7671628 ,  22.67700092],
                          [  2.8835814 ,   8.65074444,  22.67700092],
                          [  5.7671628 ,   0.        ,  22.67700092],
                          [  5.7671628 ,   2.8835814 ,  22.67700092],
                          [  5.7671628 ,   5.7671628 ,  22.67700092],
                          [  5.7671628 ,   8.65074444,  22.67700092],
                          [  8.65074444,   0.        ,  22.67700092],
                          [  8.65074444,   2.8835814 ,  22.67700092],
                          [  8.65074444,   5.7671628 ,  22.67700092],
                          [  8.65074444,   8.65074444,  22.67700092],
                          [  1.4417907 ,   1.4417907 ,  24.71600096],
                          [  1.4417907 ,   4.32537222,  24.71600096],
                          [  1.4417907 ,   7.20895386,  24.71600096],
                          [  1.4417907 ,  10.09253502,  24.71600096],
                          [  4.32537222,   1.4417907 ,  24.71600096],
                          [  4.32537222,   4.32537222,  24.71600096],
                          [  4.32537222,   7.20895386,  24.71600096],
                          [  4.32537222,  10.09253502,  24.71600096],
                          [  7.20895386,   1.4417907 ,  24.71600096],
                          [  7.20895386,   4.32537222,  24.71600096],
                          [  7.20895386,   7.20895386,  24.71600096],
                          [  7.20895386,  10.09253502,  24.71600096],
                          [ 10.09253502,   1.4417907 ,  24.71600096],
                          [ 10.09253502,   4.32537222,  24.71600096],
                          [ 10.09253502,   7.20895386,  24.71600096],
                          [ 10.09253502,  10.09253502,  24.71600096]]*Angstrom
       

electrode_elements = [Gold, Gold]
electrode_coordinates = [[ 0.        ,  0.        ,  0.        ],
                         [ 1.44179073,  1.44179073,  2.039     ]]*Angstrom

electrode_cell = [[ 2.88358145,  0.        ,  0.        ],
                  [ 0.        ,  2.88358145,  0.        ],
                  [ 0.        ,  0.        ,  4.078     ]]*Angstrom

# Set up electrodes
electrode_configuration = PeriodicAtomConfiguration(
    electrode_cell,
    electrode_elements,
    electrode_coordinates
    )

# Set up two-probe configuration
twoprobe_configuration = TwoProbeConfiguration(
    (electrode_configuration,electrode_configuration),
    scattering_elements,
    scattering_coordinates,
    electrode_repetitions=[[4,4],[4,4]],
    equivalent_atoms=([0,0],[1,98])
    )
if processIsMaster(): nlPrint(twoprobe_configuration)

######################################################################
# Central region parameters
######################################################################
exchange_correlation_type = GGA.revPBE

iteration_mixing_parameters = iterationMixingParameters(
    algorithm = IterationMixing.Pulay,
    diagonal_mixing_parameter = 0.1,
    quantity = IterationMixing.Hamiltonian,
    history_steps = 6
)

electron_density_parameters = electronDensityParameters(
    mesh_cutoff = 150.0*Rydberg,
    initial_scaled_spin = [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,
                            0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,
                            0.,  0.,  0.,  0.,  0.,  0.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,
                            1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,
                            1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,
                            1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,
                            1.,  1.,  1.,  1.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,
                            0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,
                            0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0. ]
)

basis_set_parameters_Common = basisSetParameters(
    type = DoubleZetaPolarized,
    radial_sampling_dr = 0.001*Bohr,
    energy_shift = 0.01*Rydberg,
    delta_rinn = 0.8,
    v0 = 40.0*Rydberg,
    charge = 0.0,
    split_norm = 0.15
)

basis_set_parameters_Gold = basisSetParameters(
    type = SingleZetaPolarized,
    energy_shift = 0.01*Rydberg,
    delta_rinn = 0.8,
    v0 = 40.0*Rydberg,
    charge = 0.0,
    split_norm = 0.15,
    element = Gold
)

basis_set_parameters = [
    basis_set_parameters_Common,
    basis_set_parameters_Gold
    ]

iteration_control_parameters = iterationControlParameters(
    tolerance = 1e-005,
    criterion = IterationControl.TotalEnergy,
    max_steps = 100
)

electrode_voltages = (0.0,0.0)*Volt

two_probe_algorithm_parameters = twoProbeAlgorithmParameters(
    electrode_constraint = ElectrodeConstraints.Off,
    initial_density_type = InitialDensityType.EquivalentBulk
)

energy_contour_integral_parameters = energyContourIntegralParameters(
    circle_points = 30,
    integral_lower_bound = 3*Rydberg,
    fermi_line_points = 10,
    fermi_function_poles = 4,
    real_axis_infinitesimal = 0.01*electronVolt,
    real_axis_point_density = 0.02*electronVolt
)

two_center_integral_parameters = twoCenterIntegralParameters(
    cutoff = 2500.0*Rydberg,
    points = 1024
)

######################################################################
# Left electrode parameters
######################################################################
left_electrode_electron_density_parameters = electronDensityParameters(
    mesh_cutoff = 200.0*Rydberg,
    initial_scaled_spin = [ 0.,  0. ]
)

left_electrode_iteration_control_parameters = iterationControlParameters(
    tolerance = 1e-005,
    criterion = IterationControl.TotalEnergy,
    max_steps = 100
)

left_electrode_brillouin_zone_integration_parameters = brillouinZoneIntegrationParameters(
    monkhorst_pack_parameters = (30, 30, 100)
)

left_electrode_iteration_mixing_parameters = iterationMixingParameters(
    algorithm = IterationMixing.Pulay,
    diagonal_mixing_parameter = 0.1,
    quantity = IterationMixing.Hamiltonian,
    history_steps = 6
)

left_electrode_eigenstate_occupation_parameters = eigenstateOccupationParameters(
    temperature = 1000.0*Kelvin
)

######################################################################
# Collect left electrode parameters
######################################################################
left_electrode_parameters = ElectrodeParameters(
    brillouin_zone_integration_parameters = left_electrode_brillouin_zone_integration_parameters,
    electron_density_parameters = left_electrode_electron_density_parameters,
    eigenstate_occupation_parameters = left_electrode_eigenstate_occupation_parameters,
    iteration_mixing_parameters = left_electrode_iteration_mixing_parameters,
    iteration_control_parameters = left_electrode_iteration_control_parameters
)

######################################################################
# Right electrode parameters
######################################################################
right_electrode_electron_density_parameters = electronDensityParameters(
    mesh_cutoff = 150.0*Rydberg,
    initial_scaled_spin = [ 0.,  0. ]
)

right_electrode_iteration_control_parameters = iterationControlParameters(
    tolerance = 1e-005,
    criterion = IterationControl.TotalEnergy,
    max_steps = 100
)

right_electrode_brillouin_zone_integration_parameters = brillouinZoneIntegrationParameters(
    monkhorst_pack_parameters = (30, 30, 100)
)

right_electrode_iteration_mixing_parameters = iterationMixingParameters(
    algorithm = IterationMixing.Pulay,
    diagonal_mixing_parameter = 0.1,
    quantity = IterationMixing.Hamiltonian,
    history_steps = 6
)

right_electrode_eigenstate_occupation_parameters = eigenstateOccupationParameters(
    temperature = 1000.0*Kelvin
)

######################################################################
# Collect right electrode parameters
######################################################################
right_electrode_parameters = ElectrodeParameters(
    brillouin_zone_integration_parameters = right_electrode_brillouin_zone_integration_parameters,
    electron_density_parameters = right_electrode_electron_density_parameters,
    eigenstate_occupation_parameters = right_electrode_eigenstate_occupation_parameters,
    iteration_mixing_parameters = right_electrode_iteration_mixing_parameters,
    iteration_control_parameters = right_electrode_iteration_control_parameters
)

######################################################################
# Initialize self-consistent field calculation
######################################################################
two_probe_method = TwoProbeMethod(
    electrode_parameters = (left_electrode_parameters,right_electrode_parameters),
    exchange_correlation_type = exchange_correlation_type,
    iteration_mixing_parameters = iteration_mixing_parameters,
    electron_density_parameters = electron_density_parameters,
    basis_set_parameters = basis_set_parameters,
    iteration_control_parameters = iteration_control_parameters,
    energy_contour_integral_parameters = energy_contour_integral_parameters,
    two_center_integral_parameters = two_center_integral_parameters,
    electrode_voltages = electrode_voltages,
    algorithm_parameters = two_probe_algorithm_parameters
)
if processIsMaster(): nlPrint(two_probe_method)

runtime_parameters = runtimeParameters(
    verbosity_level = 10,
    checkpoint_filename = 'AuFe2COT3Au-scf.nc'
)

# Perform self-consistent field calculation
scf = executeSelfConsistentCalculation(
    twoprobe_configuration,
    two_probe_method,
    runtime_parameters = runtime_parameters
)


Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5429
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: self-consistent
« Reply #2 on: April 7, 2011, 09:07 »
Sounds like a spurious error. I suggest you just rerun it, possible restarting from the checkpoint NC file.

Offline qnsyhanjiu

  • Heavy QuantumATK user
  • ***
  • Posts: 33
  • Reputation: 0
    • View Profile
Re: self-consistent
« Reply #3 on: April 7, 2011, 10:50 »
the script is not any questions? This computer I have been computer five days,it may be the setting  up is not right?

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5429
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: self-consistent
« Reply #4 on: April 7, 2011, 10:54 »
An error in the script would not really cause such a problem.

However, in general, the electrode is too short. You should have at least 4 layers of gold.

Offline qnsyhanjiu

  • Heavy QuantumATK user
  • ***
  • Posts: 33
  • Reputation: 0
    • View Profile
Re: self-consistent
« Reply #5 on: April 7, 2011, 17:15 »
electrode_repetitions=[[4,4],[4,4]],
this set is not the electrode's parameger? Or having the other setting up ? Thank you!

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5429
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: self-consistent
« Reply #6 on: April 7, 2011, 21:37 »
4,4 is the repetition in the XY plane. The problem is in the Z direction, you only have 2 layers, you need 4 or maybe 6.

Offline qnsyhanjiu

  • Heavy QuantumATK user
  • ***
  • Posts: 33
  • Reputation: 0
    • View Profile
Re: self-consistent
« Reply #7 on: April 8, 2011, 12:15 »
when I setup 6 6 for the x,y; the Z if at least to set 6 or 8,how can I chose x ,y,z for computering two-probe system.

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5429
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: self-consistent
« Reply #8 on: April 8, 2011, 12:41 »
The same way you set up the original system, only with 4 or 6 electrode layers instead. 8 is probably overkill.

Offline qnsyhanjiu

  • Heavy QuantumATK user
  • ***
  • Posts: 33
  • Reputation: 0
    • View Profile
Re: self-consistent
« Reply #9 on: April 9, 2011, 03:04 »
when self-consistent finished,I computer the transmission spectrum,the transmission cofficient is 0 .This is my script:
from ATK.TwoProbe import *
from ATK.MPI import processIsMaster

# Generate time stamp
if processIsMaster():
    import platform, time
    print '#',time.ctime()
    print '#',platform.node(),platform.platform()+'\n'

# Opening vnlfile
if processIsMaster(): file = VNLFile('AuFeCOT2Au_trans.vnl')

# Scattering elements and coordinates
scattering_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,     Gold,     Gold,     Gold,     
                       Gold,     Gold,     Gold,     Gold,     
                       Carbon,   Carbon,   Carbon,   Carbon,   
                       Carbon,   Carbon,   Carbon,   Carbon,   
                       Hydrogen, Hydrogen, Hydrogen, Hydrogen,
                       Hydrogen, Hydrogen, Hydrogen, Hydrogen,
                       Iron,     Carbon,   Carbon,   Carbon,   
                       Carbon,   Carbon,   Carbon,   Carbon,   
                       Carbon,   Hydrogen, Hydrogen, Hydrogen,
                       Hydrogen, Hydrogen, Hydrogen, Hydrogen,
                       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,     Gold,     Gold,     
                       Gold,     Gold,     Gold,     Gold,     
                       Gold]
scattering_coordinates = [[  0.        ,   0.        ,   4.07800007],
                          [  0.        ,   2.8835814 ,   4.07800007],
                          [  0.        ,   5.7671628 ,   4.07800007],
                          [  0.        ,   8.65074444,   4.07800007],
                          [  2.8835814 ,   0.        ,   4.07800007],
                          [  2.8835814 ,   2.8835814 ,   4.07800007],
                          [  2.8835814 ,   5.7671628 ,   4.07800007],
                          [  2.8835814 ,   8.65074444,   4.07800007],
                          [  5.7671628 ,   0.        ,   4.07800007],
                          [  5.7671628 ,   2.8835814 ,   4.07800007],
                          [  5.7671628 ,   5.7671628 ,   4.07800007],
                          [  5.7671628 ,   8.65074444,   4.07800007],
                          [  8.65074444,   0.        ,   4.07800007],
                          [  8.65074444,   2.8835814 ,   4.07800007],
                          [  8.65074444,   5.7671628 ,   4.07800007],
                          [  8.65074444,   8.65074444,   4.07800007],
                          [  1.4417907 ,   1.4417907 ,   6.1170001 ],
                          [  1.4417907 ,   4.32537222,   6.1170001 ],
                          [  1.4417907 ,   7.20895386,   6.1170001 ],
                          [  1.4417907 ,  10.09253502,   6.1170001 ],
                          [  4.32537222,   1.4417907 ,   6.1170001 ],
                          [  4.32537222,   4.32537222,   6.1170001 ],
                          [  4.32537222,   7.20895386,   6.1170001 ],
                          [  4.32537222,  10.09253502,   6.1170001 ],
                          [  7.20895386,   1.4417907 ,   6.1170001 ],
                          [  7.20895386,   4.32537222,   6.1170001 ],
                          [  7.20895386,   7.20895386,   6.1170001 ],
                          [  7.20895386,  10.09253502,   6.1170001 ],
                          [ 10.09253502,   1.4417907 ,   6.1170001 ],
                          [ 10.09253502,   4.32537222,   6.1170001 ],
                          [ 10.09253502,   7.20895386,   6.1170001 ],
                          [ 10.09253502,  10.09253502,   6.1170001 ],
                          [  3.00554715,   5.06825432,  11.02264016],
                          [  3.60000394,   3.64764951,  11.01966818],
                          [  5.02483884,   3.06347858,  11.00989404],
                          [  6.44540297,   3.65794097,  10.99904331],
                          [  7.02954911,   5.08280861,  10.99347218],
                          [  6.43509244,   6.50341343,  10.99644416],
                          [  5.01025753,   7.08758436,  11.0062183 ],
                          [  3.58969341,   6.49312197,  11.01706904],
                          [  1.8750888 ,   5.06416577,  11.03102176],
                          [  2.80354606,   2.84538208,  11.02637995],
                          [  5.02893651,   1.9329897 ,  11.01111413],
                          [  7.24765669,   2.86145579,  10.99416681],
                          [  8.16001021,   5.08689752,  10.9854655 ],
                          [  7.23155295,   7.30568133,  10.99010731],
                          [  5.00616257,   8.21807347,  11.00537313],
                          [  2.78744231,   7.28960739,  11.02232045],
                          [  5.02913646,   5.07703446,  12.60752008],
                          [  3.02872382,   5.0712603 ,  14.22156797],
                          [  3.6231805 ,   3.6506555 ,  14.21859584],
                          [  5.04801539,   3.06648456,  14.20882187],
                          [  6.46857952,   3.66094695,  14.19797096],
                          [  7.05272566,   5.0858146 ,  14.19239984],
                          [  6.45826899,   6.50641941,  14.19537196],
                          [  5.03343408,   7.09059034,  14.20514593],
                          [  3.61286997,   6.49612795,  14.21599684],
                          [  1.89826261,   5.0671714 ,  14.22957454],
                          [  2.82671987,   2.84838759,  14.22493277],
                          [  5.05211035,   1.93599545,  14.20966706],
                          [  7.2708305 ,   2.86446153,  14.19271956],
                          [  8.18318401,   5.08990314,  14.18401823],
                          [  7.25472699,   7.30868684,  14.18866024],
                          [  5.0293364 ,   8.22107922,  14.20392595],
                          [  2.81061636,   7.29261314,  14.22087321],
                          [  0.        ,   0.        ,  19.71699968],
                          [  0.        ,   2.8835814 ,  19.71699968],
                          [  0.        ,   5.7671628 ,  19.71699968],
                          [  0.        ,   8.65074444,  19.71699968],
                          [  2.8835814 ,   0.        ,  19.71699968],
                          [  2.8835814 ,   2.8835814 ,  19.71699968],
                          [  2.8835814 ,   5.7671628 ,  19.71699968],
                          [  2.8835814 ,   8.65074444,  19.71699968],
                          [  5.7671628 ,   0.        ,  19.71699968],
                          [  5.7671628 ,   2.8835814 ,  19.71699968],
                          [  5.7671628 ,   5.7671628 ,  19.71699968],
                          [  5.7671628 ,   8.65074444,  19.71699968],
                          [  8.65074444,   0.        ,  19.71699968],
                          [  8.65074444,   2.8835814 ,  19.71699968],
                          [  8.65074444,   5.7671628 ,  19.71699968],
                          [  8.65074444,   8.65074444,  19.71699968],
                          [  1.4417907 ,   1.4417907 ,  21.75599972],
                          [  1.4417907 ,   4.32537222,  21.75599972],
                          [  1.4417907 ,   7.20895386,  21.75599972],
                          [  1.4417907 ,  10.09253502,  21.75599972],
                          [  4.32537222,   1.4417907 ,  21.75599972],
                          [  4.32537222,   4.32537222,  21.75599972],
                          [  4.32537222,   7.20895386,  21.75599972],
                          [  4.32537222,  10.09253502,  21.75599972],
                          [  7.20895386,   1.4417907 ,  21.75599972],
                          [  7.20895386,   4.32537222,  21.75599972],
                          [  7.20895386,   7.20895386,  21.75599972],
                          [  7.20895386,  10.09253502,  21.75599972],
                          [ 10.09253502,   1.4417907 ,  21.75599972],
                          [ 10.09253502,   4.32537222,  21.75599972],
                          [ 10.09253502,   7.20895386,  21.75599972],
                          [ 10.09253502,  10.09253502,  21.75599972]]*Angstrom
       

electrode_elements = [Gold, Gold]
electrode_coordinates = [[ 0.        ,  0.        ,  0.        ],
                         [ 1.44179073,  1.44179073,  2.039     ]]*Angstrom

electrode_cell = [[ 2.88358145,  0.        ,  0.        ],
                  [ 0.        ,  2.88358145,  0.        ],
                  [ 0.        ,  0.        ,  4.078     ]]*Angstrom

# Set up electrodes
electrode_configuration = PeriodicAtomConfiguration(
    electrode_cell,
    electrode_elements,
    electrode_coordinates
    )

# Set up two-probe configuration
twoprobe_configuration = TwoProbeConfiguration(
    (electrode_configuration,electrode_configuration),
    scattering_elements,
    scattering_coordinates,
    electrode_repetitions=[[4,4],[4,4]],
    equivalent_atoms=([0,0],[1,81])
    )
if processIsMaster(): nlPrint(twoprobe_configuration)
if processIsMaster(): file.addToSample(twoprobe_configuration, 'AuFeCOT2Au')

######################################################################
# Central region parameters
######################################################################
exchange_correlation_type = GGA.revPBE

iteration_mixing_parameters = iterationMixingParameters(
    algorithm = IterationMixing.Pulay,
    diagonal_mixing_parameter = 0.1,
    quantity = IterationMixing.Hamiltonian,
    history_steps = 6
)

electron_density_parameters = electronDensityParameters(
    mesh_cutoff = 150.0*Rydberg,
    initial_scaled_spin = [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,
                            0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,
                            0.,  0.,  0.,  0.,  0.,  0.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,
                            1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,
                            1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,
                            0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,
                            0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,
                            0.,  0.,  0.,  0.,  0.,  0. ]
)

basis_set_parameters_Common = basisSetParameters(
    type = DoubleZetaPolarized,
    radial_sampling_dr = 0.001*Bohr,
    energy_shift = 0.01*Rydberg,
    delta_rinn = 0.8,
    v0 = 40.0*Rydberg,
    charge = 0.0,
    split_norm = 0.15
)

basis_set_parameters_Gold = basisSetParameters(
    type = SingleZetaPolarized,
    energy_shift = 0.01*Rydberg,
    delta_rinn = 0.8,
    v0 = 40.0*Rydberg,
    charge = 0.0,
    split_norm = 0.15,
    element = Gold
)

basis_set_parameters = [
    basis_set_parameters_Common,
    basis_set_parameters_Gold
    ]

iteration_control_parameters = iterationControlParameters(
    tolerance = 1e-005,
    criterion = IterationControl.TotalEnergy,
    max_steps = 100
)

electrode_voltages = (0.0,0.0)*Volt

two_probe_algorithm_parameters = twoProbeAlgorithmParameters(
    electrode_constraint = ElectrodeConstraints.Off,
    initial_density_type = InitialDensityType.EquivalentBulk
)

energy_contour_integral_parameters = energyContourIntegralParameters(
    circle_points = 30,
    integral_lower_bound = 3*Rydberg,
    fermi_line_points = 10,
    fermi_function_poles = 4,
    real_axis_infinitesimal = 0.01*electronVolt,
    real_axis_point_density = 0.02*electronVolt
)

two_center_integral_parameters = twoCenterIntegralParameters(
    cutoff = 2500.0*Rydberg,
    points = 1024
)

######################################################################
# Left electrode parameters
######################################################################
left_electrode_electron_density_parameters = electronDensityParameters(
    mesh_cutoff = 150.0*Rydberg,
    initial_scaled_spin = [ 0.,  0. ]
)

left_electrode_iteration_control_parameters = iterationControlParameters(
    tolerance = 1e-005,
    criterion = IterationControl.TotalEnergy,
    max_steps = 100
)

left_electrode_brillouin_zone_integration_parameters = brillouinZoneIntegrationParameters(
    monkhorst_pack_parameters = (30, 30, 100)
)

left_electrode_iteration_mixing_parameters = iterationMixingParameters(
    algorithm = IterationMixing.Pulay,
    diagonal_mixing_parameter = 0.1,
    quantity = IterationMixing.Hamiltonian,
    history_steps = 6
)

left_electrode_eigenstate_occupation_parameters = eigenstateOccupationParameters(
    temperature = 300.0*Kelvin
)

######################################################################
# Collect left electrode parameters
######################################################################
left_electrode_parameters = ElectrodeParameters(
    brillouin_zone_integration_parameters = left_electrode_brillouin_zone_integration_parameters,
    electron_density_parameters = left_electrode_electron_density_parameters,
    eigenstate_occupation_parameters = left_electrode_eigenstate_occupation_parameters,
    iteration_mixing_parameters = left_electrode_iteration_mixing_parameters,
    iteration_control_parameters = left_electrode_iteration_control_parameters
)

######################################################################
# Right electrode parameters
######################################################################
right_electrode_electron_density_parameters = electronDensityParameters(
    mesh_cutoff = 150.0*Rydberg,
    initial_scaled_spin = [ 0.,  0. ]
)

right_electrode_iteration_control_parameters = iterationControlParameters(
    tolerance = 1e-005,
    criterion = IterationControl.TotalEnergy,
    max_steps = 100
)

right_electrode_brillouin_zone_integration_parameters = brillouinZoneIntegrationParameters(
    monkhorst_pack_parameters = (30, 30, 100)
)

right_electrode_iteration_mixing_parameters = iterationMixingParameters(
    algorithm = IterationMixing.Pulay,
    diagonal_mixing_parameter = 0.1,
    quantity = IterationMixing.Hamiltonian,
    history_steps = 6
)

right_electrode_eigenstate_occupation_parameters = eigenstateOccupationParameters(
    temperature = 300.0*Kelvin
)

######################################################################
# Collect right electrode parameters
######################################################################
right_electrode_parameters = ElectrodeParameters(
    brillouin_zone_integration_parameters = right_electrode_brillouin_zone_integration_parameters,
    electron_density_parameters = right_electrode_electron_density_parameters,
    eigenstate_occupation_parameters = right_electrode_eigenstate_occupation_parameters,
    iteration_mixing_parameters = right_electrode_iteration_mixing_parameters,
    iteration_control_parameters = right_electrode_iteration_control_parameters
)

######################################################################
# Initialize self-consistent field calculation
######################################################################
two_probe_method = TwoProbeMethod(
    electrode_parameters = (left_electrode_parameters,right_electrode_parameters),
    exchange_correlation_type = exchange_correlation_type,
    iteration_mixing_parameters = iteration_mixing_parameters,
    electron_density_parameters = electron_density_parameters,
    basis_set_parameters = basis_set_parameters,
    iteration_control_parameters = iteration_control_parameters,
    energy_contour_integral_parameters = energy_contour_integral_parameters,
    two_center_integral_parameters = two_center_integral_parameters,
    electrode_voltages = electrode_voltages,
    algorithm_parameters = two_probe_algorithm_parameters
)
if processIsMaster(): nlPrint(two_probe_method)

# Restore self consistent calculation from check point file
scf = restoreSelfConsistentCalculation(
    filename = 'AuFeCOT2Au-scf.nc'
)
######################################################################
# Calculate physical properties
######################################################################
import numpy
transmission_spectrum = calculateTransmissionSpectrum(
    self_consistent_calculation = scf,
    energies = numpy.arange(-2.0, 2.0, 0.01)*electronVolt,
    brillouin_zone_integration_parameters = brillouinZoneIntegrationParameters((30, 30)),
    green_function_infinitesimal = 1.0e-5*electronVolt
)
if processIsMaster(): nlPrint(transmission_spectrum)
if processIsMaster(): file.addToSample(transmission_spectrum, 'AuFeCOT2Au', 'Transmission Spectrum')