Author Topic: LDOS calculation of a spin-polarized bulk in older version  (Read 1105 times)

0 Members and 1 Guest are viewing this topic.

Offline beauyy

  • Heavy QuantumATK user
  • ***
  • Posts: 50
  • Country: cn
  • Reputation: 0
    • View Profile
Hi all,

I have read the tutorial: 
http://docs.quantumatk.com/tutorials/tamr_ldos/tamr_ldos.html#stm-simulations-of-tunneling-anisotropic-magneto-resistance-tamr. This is new for QuantumATK S-2021.06.

The script W8_Fe2_Co.py in the tutorial can not run  in 2018 version. Is it possible to modify the script to run in 2018 version? If possible, how can I modify it?

The original script of W8_Fe2_Co.py in 2021 version is:
# -*- coding: utf-8 -*-
# -------------------------------------------------------------
# Bulk Configuration
# -------------------------------------------------------------

angles = [(0,0), (90, 150)]

for (theta, phi) in angles:
    filename = 'W8-Fe2-Co-2x2-theta_{}-phi_{}.hdf5'.format(theta, phi)

    # Set up lattice
    vector_a = [5.482287216117011, 0.0, 0.0]*Angstrom
    vector_b = [-1.827429072039004, 5.168749955904878, 0.0]*Angstrom
    vector_c = [0.0, 0.0, 44.9670510707337]*Angstrom
    lattice = UnitCell(vector_a, vector_b, vector_c)

    # Define elements
    elements = [Tungsten, Tungsten, Tungsten, Tungsten, Tungsten, Tungsten,
                Tungsten, Tungsten, Tungsten, Tungsten, Tungsten, Tungsten,
                Tungsten, Tungsten, Tungsten, Tungsten, Tungsten, Tungsten,
                Tungsten, Tungsten, Tungsten, Tungsten, Tungsten, Tungsten,
                Tungsten, Tungsten, Tungsten, Tungsten, Tungsten, Tungsten,
                Tungsten, Tungsten, Iron, Iron, Iron, Iron, Iron, Iron, Iron, Iron,
                Cobalt]

    # Define coordinates
    fractional_coordinates = [[ 0.25          ,  0.25          ,  0.30118631364 ],
                              [ 0.25          ,  0.75          ,  0.301186278457],
                              [ 0.75          ,  0.25          ,  0.301186278457],
                              [ 0.75          ,  0.75          ,  0.301186242332],
                              [-0.000000998907, -0.000000998907,  0.350454016187],
                              [-0.000000503015,  0.500000503015,  0.350454015157],
                              [ 0.500000503015, -0.000000503015,  0.350454015157],
                              [ 0.500000998907,  0.500000998907,  0.350454016187],
                              [ 0.25          ,  0.25          ,  0.400260701577],
                              [ 0.25          ,  0.75          ,  0.400261649879],
                              [ 0.75          ,  0.25          ,  0.400261649879],
                              [ 0.75          ,  0.75          ,  0.400262571411],
                              [ 0.000013667016,  0.000013667016,  0.450062461809],
                              [ 0.000006758676,  0.499993241324,  0.450062741191],
                              [ 0.499993241324,  0.000006758676,  0.450062741191],
                              [ 0.499986332984,  0.499986332984,  0.450062461809],
                              [ 0.25          ,  0.25          ,  0.499890596355],
                              [ 0.25          ,  0.75          ,  0.49988412114 ],
                              [ 0.75          ,  0.25          ,  0.49988412114 ],
                              [ 0.75          ,  0.75          ,  0.499873815331],
                              [-0.000133552734, -0.000133552734,  0.54969793658 ],
                              [-0.000065862576,  0.500065862576,  0.549705930495],
                              [ 0.500065862576, -0.000065862576,  0.549705930495],
                              [ 0.500133552734,  0.500133552734,  0.54969793658 ],
                              [ 0.25          ,  0.25          ,  0.599373131644],
                              [ 0.25          ,  0.75          ,  0.599538357583],
                              [ 0.75          ,  0.25          ,  0.599538357583],
                              [ 0.75          ,  0.75          ,  0.599633530735],
                              [ 0.003412645763,  0.003412645763,  0.649063001825],
                              [-0.000133957938,  0.500133957938,  0.649263802117],
                              [ 0.500133957938, -0.000133957938,  0.649263802117],
                              [ 0.496587354237,  0.496587354237,  0.649063001825],
                              [ 0.25          ,  0.25          ,  0.696649707841],
                              [ 0.25          ,  0.75          ,  0.694517503389],
                              [ 0.75          ,  0.25          ,  0.694517503389],
                              [ 0.75          ,  0.75          ,  0.691660105602],
                              [-0.043518053127, -0.043518053127,  0.734575517354],
                              [ 0.012602780483,  0.487397219517,  0.735779056149],
                              [ 0.487397219517,  0.012602780483,  0.735779056149],
                              [ 0.543518053127,  0.543518053127,  0.734575517354],
                              [ 0.25          ,  0.25          ,  0.763611260037]]

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

    # Add tags
    bulk_configuration.addTags('molecule0_Co', [40])
    bulk_configuration.addTags('substrate',    [ 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])

    # -------------------------------------------------------------
    # Calculator
    # -------------------------------------------------------------
    #----------------------------------------
    # Basis Set
    #----------------------------------------
    basis_set = [
        BasisGGAPseudoDojoSO.Iron_Medium,
        BasisGGAPseudoDojoSO.Cobalt_Medium,
        BasisGGAPseudoDojoSO.Tungsten_Medium,
        ]

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

    k_point_sampling = KpointDensity(
        density_a=7.0*Angstrom,
        density_c=0.0*Angstrom,
        force_timereversal=False,
        )
    numerical_accuracy_parameters = NumericalAccuracyParameters(
        density_mesh_cutoff=120.0*Hartree,
        k_point_sampling=k_point_sampling,
        )

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

    bulk_configuration.setCalculator(calculator)

    # -------------------------------------------------------------
    # Initial State
    # -------------------------------------------------------------
    scaled_spins = [(i, 1.0, theta*Degrees, phi*Degrees) for i in range(len(bulk_configuration))]

    initial_spin = InitialSpin(scaled_spins=scaled_spins)

    bulk_configuration.setCalculator(
        calculator,
        initial_spin=initial_spin,
    )
    bulk_configuration.update()
    nlsave(filename, bulk_configuration)
    nlprint(bulk_configuration)

    # -------------------------------------------------------------
    # Local Density Of States
    # -------------------------------------------------------------
    kpoints = KpointDensity(
        density_a=17.0*Angstrom,
        density_c=0.0*Angstrom,
        force_timereversal=False,
        )

    local_density_of_states = LocalDensityOfStates(
        configuration=bulk_configuration,
        kpoints=kpoints,
        energies=numpy.linspace(-0.2, 0.8, 41)*eV,
        band_indices=All,
        energy_zero_parameter=FermiLevel,
        spectrum_method=GaussianBroadening(0.025*eV),
        density_mesh_cutoff=30*Hartree,
        )
    nlsave(filename, local_density_of_states)

    # -------------------------------------------------------------
    # Mulliken Population
    # -------------------------------------------------------------
    mulliken_population = MullikenPopulation(bulk_configuration)
    nlsave(filename, mulliken_population)
    nlprint(mulliken_population)


« Last Edit: December 2, 2022, 03:31 by beauyy »

Offline Ulrik G. Vej-Hansen

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 425
  • Country: dk
  • Reputation: 8
    • View Profile
Re: LDOS calculation of a spin-polarized bulk in older version
« Reply #1 on: December 5, 2022, 15:04 »
No, the LocalDensityofStates was not present in the O-2018.06 version. As far as I remember, it was introduced in the Q-2019.12 version, so you could try that one. We recommend upgrading to the newest version, U-2022.12 just came out today.