Author Topic: How to set the magnetization of the electrodes ?  (Read 2472 times)

0 Members and 1 Guest are viewing this topic.

Offline ainunK

  • Regular QuantumATK user
  • **
  • Posts: 17
  • Country: my
  • Reputation: 0
    • View Profile
How to set the magnetization of the electrodes ?
« on: November 21, 2019, 06:03 »
Dear sir,

Im a newbie to Quantum ATK. I want to study on graphene (AGNR) based logic gates. I have difficulties to understand on how to set magnetization of the electrodes and where to set it in Quantum ATK. I want to set magnetization of left electrode to -1 (magnetized) and right electrode is set to 0 (non-magnetic).

Offline Petr Khomyakov

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 1290
  • Country: dk
  • Reputation: 25
    • View Profile

Offline ainunK

  • Regular QuantumATK user
  • **
  • Posts: 17
  • Country: my
  • Reputation: 0
    • View Profile
Re: How to set the magnetization of the electrodes ?
« Reply #2 on: November 28, 2019, 08:51 »
Hi,

I still not understand the tutorial. Do I need to set it in bulk configuration ? Can you please check it and tell me where i did my mistakes :( ?


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

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

# Define coordinates
fractional_coordinates = [[ 0.5           ,  0.220392144016,  0.127551466439],
                          [ 0.5           ,  0.220392144016,  0.330705212018],
                          [ 0.5           ,  0.220392144016,  0.533858957596],
                          [ 0.5           ,  0.220392144016,  0.737012703175],
                          [ 0.5           ,  0.220392144016,  0.940166448754],
                          [ 0.5           ,  0.406797381339,  0.161410424035],
                          [ 0.5           ,  0.406797381339,  0.364564169614],
                          [ 0.5           ,  0.406797381339,  0.567717915193],
                          [ 0.5           ,  0.406797381339,  0.770871660772],
                          [ 0.5           ,  0.406797381339,  0.974025406351],
                          [ 0.5           ,  0.220392144016,  0.059833551246],
                          [ 0.5           ,  0.220392144016,  0.262987296825],
                          [ 0.5           ,  0.220392144016,  0.466141042404],
                          [ 0.5           ,  0.220392144016,  0.669294787982],
                          [ 0.5           ,  0.220392144016,  0.872448533561],
                          [ 0.5           ,  0.593202618661,  0.127551466439],
                          [ 0.5           ,  0.593202618661,  0.330705212018],
                          [ 0.5           ,  0.593202618661,  0.533858957596],
                          [ 0.5           ,  0.593202618661,  0.737012703175],
                          [ 0.5           ,  0.593202618661,  0.940166448754],
                          [ 0.5           ,  0.779607855984,  0.161410424035],
                          [ 0.5           ,  0.779607855984,  0.364564169614],
                          [ 0.5           ,  0.779607855984,  0.567717915193],
                          [ 0.5           ,  0.779607855984,  0.770871660772],
                          [ 0.5           ,  0.779607855984,  0.974025406351],
                          [ 0.5           ,  0.406797381339,  0.025974593649],
                          [ 0.5           ,  0.406797381339,  0.229128339228],
                          [ 0.5           ,  0.406797381339,  0.432282084807],
                          [ 0.5           ,  0.406797381339,  0.635435830386],
                          [ 0.5           ,  0.406797381339,  0.838589575965],
                          [ 0.5           ,  0.593202618661,  0.059833551246],
                          [ 0.5           ,  0.593202618661,  0.262987296825],
                          [ 0.5           ,  0.593202618661,  0.466141042404],
                          [ 0.5           ,  0.593202618661,  0.669294787982],
                          [ 0.5           ,  0.593202618661,  0.872448533561],
                          [ 0.5           ,  0.779607855984,  0.025974593649],
                          [ 0.5           ,  0.779607855984,  0.229128339228],
                          [ 0.5           ,  0.779607855984,  0.432282084807],
                          [ 0.5           ,  0.779607855984,  0.635435830386],
                          [ 0.5           ,  0.779607855984,  0.838589575965],
                          [ 0.5           ,  0.077393049027,  0.153526060088],
                          [ 0.5           ,  0.077393049027,  0.356679805667],
                          [ 0.5           ,  0.077393049027,  0.559833551246],
                          [ 0.5           ,  0.077393049027,  0.762987296825],
                          [ 0.5           ,  0.077393049027,  0.966141042404],
                          [ 0.5           ,  0.077393049027,  0.033858957596],
                          [ 0.5           ,  0.077393049027,  0.237012703175],
                          [ 0.5           ,  0.077393049027,  0.440166448754],
                          [ 0.5           ,  0.077393049027,  0.643320194333],
                          [ 0.5           ,  0.077393049027,  0.846473939912],
                          [ 0.5           ,  0.922606950973,  0.135435830386],
                          [ 0.5           ,  0.922606950973,  0.338589575965],
                          [ 0.5           ,  0.922606950973,  0.541743321544],
                          [ 0.5           ,  0.922606950973,  0.744897067122],
                          [ 0.5           ,  0.922606950973,  0.948050812701],
                          [ 0.5           ,  0.922606950973,  0.051949187299],
                          [ 0.5           ,  0.922606950973,  0.255102932878],
                          [ 0.5           ,  0.922606950973,  0.458256678456],
                          [ 0.5           ,  0.922606950973,  0.661410424035],
                          [ 0.5           ,  0.922606950973,  0.864564169614]]

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

#----------------------------------------
# Basis Set
#----------------------------------------
basis_set = [
    LDABasis.Hydrogen_SingleZeta,
    LDABasis.Carbon_SingleZeta,
    ]

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

k_point_sampling = MonkhorstPackGrid(
    na=1,
    nb=1,
    nc=100,
    symmetries=[
        ([[ 1., 0., 0.],
          [ 0., 1., 0.],
          [ 0., 0., 1.]], [ 0., 0., 0.]),
        ([[-1., 0., 0.],
          [ 0.,-1., 0.],
          [ 0., 0.,-1.]], [ 0., 0., 0.]),
        ],
    force_timereversal=True,
    shift_to_gamma=[True, True, True],
    )
numerical_accuracy_parameters = NumericalAccuracyParameters(
    k_point_sampling=k_point_sampling,
    density_mesh_cutoff=150.0*Rydberg,
    )

calculator = LCAOCalculator(
    basis_set=basis_set,
    exchange_correlation=exchange_correlation,
    numerical_accuracy_parameters=numerical_accuracy_parameters,
    )
bulk_configuration.setCalculator(calculator)




Offline ainunK

  • Regular QuantumATK user
  • **
  • Posts: 17
  • Country: my
  • Reputation: 0
    • View Profile
Re: How to set the magnetization of the electrodes ?
« Reply #3 on: November 28, 2019, 08:52 »
This one in device configuration.

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

# Set up lattice
vector_a = [10.0, 0.0, 0.0]*Angstrom
vector_b = [0.0, 6.60121396209, 0.0]*Angstrom
vector_c = [0.0, 0.0, 4.26258]*Angstrom
left_electrode_lattice = UnitCell(vector_a, vector_b, vector_c)

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

# Define coordinates
left_electrode_coordinates = [[ 5.            ,  2.685356553432,  0.71043       ],
                              [ 5.            ,  5.146358263875,  0.71043       ],
                              [ 5.            ,  0.510888075804,  0.875860039097],
                              [ 5.            ,  6.090325886281,  1.255429960903],
                              [ 5.            ,  1.454855698211,  1.42086       ],
                              [ 5.            ,  3.915857408654,  1.42086       ],
                              [ 5.            ,  1.454855698211,  2.84172       ],
                              [ 5.            ,  3.915857408654,  2.84172       ],
                              [ 5.            ,  6.090325886281,  3.007150039097],
                              [ 5.            ,  0.510888075804,  3.386719960903],
                              [ 5.            ,  2.685356553432,  3.55215       ],
                              [ 5.            ,  5.146358263875,  3.55215       ]]*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 = [10.0, 0.0, 0.0]*Angstrom
vector_b = [0.0, 6.60121396209, 0.0]*Angstrom
vector_c = [0.0, 0.0, 4.26258]*Angstrom
right_electrode_lattice = UnitCell(vector_a, vector_b, vector_c)

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

# Define coordinates
right_electrode_coordinates = [[ 5.            ,  2.685356553432,  0.71043       ],
                               [ 5.            ,  5.146358263875,  0.71043       ],
                               [ 5.            ,  0.510888075804,  0.875860039097],
                               [ 5.            ,  6.090325886281,  1.255429960903],
                               [ 5.            ,  1.454855698211,  1.42086       ],
                               [ 5.            ,  3.915857408654,  1.42086       ],
                               [ 5.            ,  1.454855698211,  2.84172       ],
                               [ 5.            ,  3.915857408654,  2.84172       ],
                               [ 5.            ,  6.090325886281,  3.007150039097],
                               [ 5.            ,  0.510888075804,  3.386719960903],
                               [ 5.            ,  2.685356553432,  3.55215       ],
                               [ 5.            ,  5.146358263875,  3.55215       ]]*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 = [10.0, 0.0, 0.0]*Angstrom
vector_b = [0.0, 6.60121396209, 0.0]*Angstrom
vector_c = [0.0, 0.0, 21.3129]*Angstrom
central_region_lattice = UnitCell(vector_a, vector_b, vector_c)

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

# Define coordinates
central_region_coordinates = [[  5.            ,   2.685356553432,   0.71043       ],
                              [  5.            ,   5.146358263875,   0.71043       ],
                              [  5.            ,   0.510888075804,   0.875860039097],
                              [  5.            ,   6.090325886281,   1.255429960903],
                              [  5.            ,   1.454855698211,   1.42086       ],
                              [  5.            ,   3.915857408654,   1.42086       ],
                              [  5.            ,   1.454855698211,   2.84172       ],
                              [  5.            ,   3.915857408654,   2.84172       ],
                              [  5.            ,   6.090325886281,   3.007150039097],
                              [  5.            ,   0.510888075804,   3.386719960903],
                              [  5.            ,   2.685356553432,   3.55215       ],
                              [  5.            ,   5.146358263875,   3.55215       ],
                              [  5.            ,   2.685356553432,   4.97301       ],
                              [  5.            ,   5.146358263875,   4.97301       ],
                              [  5.            ,   0.510888075804,   5.138440039097],
                              [  5.            ,   6.090325886281,   5.518009960903],
                              [  5.            ,   1.454855698211,   5.68344       ],
                              [  5.            ,   3.915857408654,   5.68344       ],
                              [  5.            ,   1.454855698211,   7.1043        ],
                              [  5.            ,   3.915857408654,   7.1043        ],
                              [  5.            ,   6.090325886281,   7.269730039097],
                              [  5.            ,   0.510888075804,   7.649299960903],
                              [  5.            ,   2.685356553432,   7.81473       ],
                              [  5.            ,   5.146358263875,   7.81473       ],
                              [  5.            ,   2.685356553432,   9.23559       ],
                              [  5.            ,   5.146358263875,   9.23559       ],
                              [  5.            ,   0.510888075804,   9.401020039097],
                              [  5.            ,   6.090325886281,   9.780589960903],
                              [  5.            ,   1.454855698211,   9.94602       ],
                              [  5.            ,   3.915857408654,   9.94602       ],
                              [  5.            ,   1.454855698211,  11.36688       ],
                              [  5.            ,   3.915857408654,  11.36688       ],
                              [  5.            ,   6.090325886281,  11.532310039097],
                              [  5.            ,   0.510888075804,  11.911879960903],
                              [  5.            ,   2.685356553432,  12.07731       ],
                              [  5.            ,   5.146358263875,  12.07731       ],
                              [  5.            ,   2.685356553432,  13.49817       ],
                              [  5.            ,   5.146358263875,  13.49817       ],
                              [  5.            ,   0.510888075804,  13.663600039097],
                              [  5.            ,   6.090325886281,  14.043169960903],
                              [  5.            ,   1.454855698211,  14.2086        ],
                              [  5.            ,   3.915857408654,  14.2086        ],
                              [  5.            ,   1.454855698211,  15.62946       ],
                              [  5.            ,   3.915857408654,  15.62946       ],
                              [  5.            ,   6.090325886281,  15.794890039097],
                              [  5.            ,   0.510888075804,  16.174459960903],
                              [  5.            ,   2.685356553432,  16.33989       ],
                              [  5.            ,   5.146358263875,  16.33989       ],
                              [  5.            ,   2.685356553432,  17.76075       ],
                              [  5.            ,   5.146358263875,  17.76075       ],
                              [  5.            ,   0.510888075804,  17.926180039097],
                              [  5.            ,   6.090325886281,  18.305749960903],
                              [  5.            ,   1.454855698211,  18.47118       ],
                              [  5.            ,   3.915857408654,  18.47118       ],
                              [  5.            ,   1.454855698211,  19.89204       ],
                              [  5.            ,   3.915857408654,  19.89204       ],
                              [  5.            ,   6.090325886281,  20.057470039097],
                              [  5.            ,   0.510888075804,  20.437039960903],
                              [  5.            ,   2.685356553432,  20.60247       ],
                              [  5.            ,   5.146358263875,  20.60247       ]]*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=[8.52516, 8.52516]*Angstrom,
    )

#----------------------------------------
# Basis Set
#----------------------------------------
basis_set = [
    LDABasis.Hydrogen_SingleZeta,
    LDABasis.Carbon_SingleZeta,
    ]

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

#----------------------------------------
# Numerical Accuracy Settings
#----------------------------------------
left_electrode_numerical_accuracy_parameters = NumericalAccuracyParameters(
    density_mesh_cutoff=150.0*Rydberg,
    )

right_electrode_numerical_accuracy_parameters = NumericalAccuracyParameters(
    density_mesh_cutoff=150.0*Rydberg,
    )

device_numerical_accuracy_parameters = NumericalAccuracyParameters(
    density_mesh_cutoff=150.0*Rydberg,
    )

#----------------------------------------
# Poisson Solver Settings
#----------------------------------------
left_electrode_poisson_solver = FastFourier2DSolver(
    boundary_conditions=[[PeriodicBoundaryCondition(),PeriodicBoundaryCondition()],
                         [PeriodicBoundaryCondition(),PeriodicBoundaryCondition()],
                         [PeriodicBoundaryCondition(),PeriodicBoundaryCondition()]]
    )

right_electrode_poisson_solver = FastFourier2DSolver(
    boundary_conditions=[[PeriodicBoundaryCondition(),PeriodicBoundaryCondition()],
                         [PeriodicBoundaryCondition(),PeriodicBoundaryCondition()],
                         [PeriodicBoundaryCondition(),PeriodicBoundaryCondition()]]
    )

device_poisson_solver = FastFourier2DSolver(
    boundary_conditions=[[PeriodicBoundaryCondition(),PeriodicBoundaryCondition()],
                         [PeriodicBoundaryCondition(),PeriodicBoundaryCondition()],
                         [DirichletBoundaryCondition(),NeumannBoundaryCondition()]]
    )

#----------------------------------------
# Contour Integral Settings
#----------------------------------------
equilibrium_contour = SemiCircleContour(
    integral_lower_bound=1.87054058324*Hartree,
    circle_eccentricity=0.3,
    logarithmic_bunching=0.3,
    circle_points=30,
    fermi_line_points=10,
    fermi_function_poles=8,
    )
contour_parameters = ContourParameters(
    equilibrium_contour=equilibrium_contour,
    )

#----------------------------------------
# Electrode Calculators
#----------------------------------------
left_electrode_calculator = LCAOCalculator(
    basis_set=basis_set,
    exchange_correlation=exchange_correlation,
    numerical_accuracy_parameters=left_electrode_numerical_accuracy_parameters,
    poisson_solver=left_electrode_poisson_solver,
    )

right_electrode_calculator = LCAOCalculator(
    basis_set=basis_set,
    exchange_correlation=exchange_correlation,
    numerical_accuracy_parameters=right_electrode_numerical_accuracy_parameters,
    poisson_solver=right_electrode_poisson_solver,
    )

#----------------------------------------
# Device Calculator
#----------------------------------------
calculator = DeviceLCAOCalculator(
    basis_set=basis_set,
    exchange_correlation=exchange_correlation,
    numerical_accuracy_parameters=device_numerical_accuracy_parameters,
    poisson_solver=device_poisson_solver,
    contour_parameters=contour_parameters,
    electrode_calculators=
        [left_electrode_calculator, right_electrode_calculator],
    electrode_voltages=( 2.0*Volt, 0.0*Volt),
    )
device_configuration.setCalculator(calculator)