QuantumATK Forum

QuantumATK => General Questions and Answers => Topic started by: zhangguangping on April 29, 2016, 15:15

Title: Tutorial of Inelastic electron tunneling spectrum
Post by: zhangguangping on April 29, 2016, 15:15
Dear all,

Is there a detail tutorial for Inelastic electron tunneling spectrum (IETS)? I saw this can be realized in InelasticTransmissionSpectrum Class. However, I did not find a detailed tutorial of how to use it:
(1) how to set the dynamical region when calculate the phonon.
(2) how to inspect the vibrational mode after the phonon calculation.
(3) how to calculate the IETS based on the above data.

With best regards,

/Guangping

Moderator edit: Confusing spelling mistake in subject corrected.
Title: Re: Tutorial of Inelastic electron tunneling spectrum
Post by: Anders Blom on April 30, 2016, 23:49
See http://quantumwise.com/publications/tutorials/item/877-inelastic-electron-spectroscopy-of-h-molecule-between-1d-au-chains
Title: Re: Tutorial of Inelastic electron tunneling spectrum
Post by: zhangguangping on May 1, 2016, 00:54
Dear Anders,

Thanks for your reply.

I will read it carefully, and try to understand the process of calculation IETS in ATK.

With best regards,

Guangping
Title: Re: Tutorial of Inelastic electron tunneling spectrum
Post by: zhangguangping on August 4, 2016, 06:01
Dear Anders,

Thanks for your reply.

I will read it carefully, and try to understand the process of calculation IETS in ATK.

With best regards,

Guangping

Dear Anders,

I have followed the tutorial, but still have some questions on the calculation of IETS in ATK.

(1) In the tutorial, it metioned that "The dynamical matrix can be calculated in parallel over the atomic displacements in each direction. Consequently this calculation can be performed efficiently using six cores." So, to speed up the calculation, the cores used must be six or multiple of six, in that each core has a very similar computational load, right?

(2) Concerning the setting of q-points in vibration calculation, if I just inlcude the molecule in a molecular junction in the "Dynamical Matrix" calcualtion, can I safely set a 1x1 q-point sampling since the molecular is supposed not to interact wtih its image in repetition unit cells ?

(3) What is the effect of "repetitions=(x, x, x)" in "DynamicalMatrix" and "HamiltonianDerivatives" class? As the reason stated in (2), can I safely set repetitions=(1, 1, 1)? I found, it is ok for DynamicalMatrix, but not for HamiltonianDerivatives. I get errors like

Code
Traceback (most recent call last):
  File "/tmp/1366.node00/CH3-C7-Au-IETS.py", line 463, in <module>
Traceback (most recent call last):
  File "/tmp/1366.node00/CH3-C7-Au-IETS.py", line 463, in <module>
Traceback (most recent call last):
  File "/tmp/1366.node00/CH3-C7-Au-IETS.py", line 463, in <module>
    Traceback (most recent call last):
  File "/tmp/1366.node00/CH3-C7-Au-IETS.py", line 463, in <module>
    use_equivalent_bulk=True,
    use_equivalent_bulk=True,
  File "./zipdir/NL/Analysis/HamiltonianDerivatives.py", line 132, in __init__
  File "./zipdir/NL/Analysis/HamiltonianDerivatives.py", line 132, in __init__
use_equivalent_bulk=True,
  File "./zipdir/NL/Analysis/HamiltonianDerivatives.py", line 132, in __init__
Traceback (most recent call last):
    use_equivalent_bulk=True,
  File "./zipdir/NL/Analysis/HamiltonianDerivatives.py", line 132, in __init__
Traceback (most recent call last):
  File "/tmp/1366.node00/CH3-C7-Au-IETS.py", line 463, in <module>
  File "/tmp/1366.node00/CH3-C7-Au-IETS.py", line 463, in <module>
Traceback (most recent call last):
  File "/tmp/1366.node00/CH3-C7-Au-IETS.py", line 463, in <module>
    use_equivalent_bulk=True,
  File "./zipdir/NL/Analysis/HamiltonianDerivatives.py", line 132, in __init__
    use_equivalent_bulk=True,
  File "./zipdir/NL/Analysis/HamiltonianDerivatives.py", line 132, in __init__
Traceback (most recent call last):
  File "/tmp/1366.node00/CH3-C7-Au-IETS.py", line 463, in <module>
    use_equivalent_bulk=True,
  File "./zipdir/NL/Analysis/HamiltonianDerivatives.py", line 132, in __init__
    use_equivalent_bulk=True,
  File "./zipdir/NL/Analysis/HamiltonianDerivatives.py", line 132, in __init__
Traceback (most recent call last):
  File "/tmp/1366.node00/CH3-C7-Au-IETS.py", line 463, in <module>
Traceback (most recent call last):
  File "/tmp/1366.node00/CH3-C7-Au-IETS.py", line 463, in <module>
Traceback (most recent call last):
  File "/tmp/1366.node00/CH3-C7-Au-IETS.py", line 463, in <module>
    use_equivalent_bulk=True,
Traceback (most recent call last):
  File "/tmp/1366.node00/CH3-C7-Au-IETS.py", line 463, in <module>
  File "./zipdir/NL/Analysis/HamiltonianDerivatives.py", line 132, in __init__
    use_equivalent_bulk=True,
  File "./zipdir/NL/Analysis/HamiltonianDerivatives.py", line 132, in __init__
    use_equivalent_bulk=True,
  File "./zipdir/NL/Analysis/HamiltonianDerivatives.py", line 132, in __init__
    use_equivalent_bulk=True,
  File "./zipdir/NL/Analysis/HamiltonianDerivatives.py", line 132, in __init__
  File "./zipdir/NL/Analysis/HamiltonianDerivatives.py", line 978, in setAndCheckAtomsDisplacedWithinSuperCell
  File "./zipdir/NL/Analysis/HamiltonianDerivatives.py", line 978, in setAndCheckAtomsDisplacedWithinSuperCell
  File "./zipdir/NL/Analysis/HamiltonianDerivatives.py", line 978, in setAndCheckAtomsDisplacedWithinSuperCell
  File "./zipdir/NL/Analysis/HamiltonianDerivatives.py", line 978, in setAndCheckAtomsDisplacedWithinSuperCell
  File "./zipdir/NL/Analysis/HamiltonianDerivatives.py", line 978, in setAndCheckAtomsDisplacedWithinSuperCell
  File "./zipdir/NL/Analysis/HamiltonianDerivatives.py", line 978, in setAndCheckAtomsDisplacedWithinSuperCell
NL.ComputerScienceUtilities.Exceptions.NLValueError:   File "./zipdir/NL/Analysis/HamiltonianDerivatives.py", line 978, in setAndCheckAtomsDisplacedWithinSuperCell
NL.ComputerScienceUtilities.Exceptions.NLValueError: Atoms are being displaced out of the unit cell in directions where the cell repetition is less that 3. Please increase the unit cell repetition in the direction(s): A.
NL.ComputerScienceUtilities.Exceptions.NLValueError: Atoms are being displaced out of the unit cell in directions where the cell repetition is less that 3. Please increase the unit cell repetition in the direction(s): A.
Atoms are being displaced out of the unit cell in directions where the cell repetition is less that 3. Please increase the unit cell repetition in the direction(s): A.
NL.ComputerScienceUtilities.Exceptions.NLValueError: Atoms are being displaced out of the unit cell in directions where the cell repetition is less that 3. Please increase the unit cell repetition in the direction(s): A.
  File "./zipdir/NL/Analysis/HamiltonianDerivatives.py", line 978, in setAndCheckAtomsDisplacedWithinSuperCell
  File "./zipdir/NL/Analysis/HamiltonianDerivatives.py", line 978, in setAndCheckAtomsDisplacedWithinSuperCell
NL.ComputerScienceUtilities.Exceptions.NLValueError: Atoms are being displaced out of the unit cell in directions where the cell repetition is less that 3. Please increase the unit cell repetition in the direction(s): A.
NL.ComputerScienceUtilities.Exceptions.NLValueError: Atoms are being displaced out of the unit cell in directions where the cell repetition is less that 3. Please increase the unit cell repetition in the direction(s): A.
  File "./zipdir/NL/Analysis/HamiltonianDerivatives.py", line 978, in setAndCheckAtomsDisplacedWithinSuperCell
  File "./zipdir/NL/Analysis/HamiltonianDerivatives.py", line 978, in setAndCheckAtomsDisplacedWithinSuperCell
NL.ComputerScienceUtilities.Exceptions.NLValueError: Atoms are being displaced out of the unit cell in directions where the cell repetition is less that 3. Please increase the unit cell repetition in the direction(s): A.
NL.ComputerScienceUtilities.Exceptions.NLValueError: Atoms are being displaced out of the unit cell in directions where the cell repetition is less that 3. Please increase the unit cell repetition in the direction(s): A.
NL.ComputerScienceUtilities.Exceptions.NLValueError: Atoms are being displaced out of the unit cell in directions where the cell repetition is less that 3. Please increase the unit cell repetition in the direction(s): A.
  File "./zipdir/NL/Analysis/HamiltonianDerivatives.py", line 978, in setAndCheckAtomsDisplacedWithinSuperCell
NL.ComputerScienceUtilities.Exceptions.NLValueError: Atoms are being displaced out of the unit cell in directions where the cell repetition is less that 3. Please increase the unit cell repetition in the direction(s): A.
NL.ComputerScienceUtilities.ExceptionsNL.ComputerScienceUtilities.Exceptions.NLValueError: Atoms are being displaced out of the unit cell in directions where the cell repetition is less that 3. Please increase the unit cell repetition in the direction(s): A.
.NLValueError: Atoms are being displaced out of the unit cell in directions where the cell repetition is less that 3. Please increase the unit cell repetition in the direction(s): A.

(4) How to continue an IETS calculation in ATK?

For example, in the .py file the main calculation are lined as the following as instructed in the tutorial Au-H2-Au.
Code
...
device_configuration.update()
...
dynamical_matrix = DynamicalMatrix(...)
...
vibrational_mode = VibrationalMode(...)
...
hamiltonian_derivatives = HamiltonianDerivatives(...)
...
inelastic_transmission_spectrum = InelasticTransmissionSpectrum(...)

Like the case in (3), how can one continue the job?

Can you give me some help on this?

Thanks so much.
Title: Re: Tutorial of Inelastic electron tunneling spectrum
Post by: zhangguangping on August 13, 2016, 05:09
See http://quantumwise.com/publications/tutorials/item/877-inelastic-electron-spectroscopy-of-h-molecule-between-1d-au-chains

Dear Anders,

For the the 4th question raised in the last thread, I have found the answer in the manual. One can seperately calculate the "device_configuration.update()", "DynamicalMatrix", "HamiltonianDerivatives" and saved in seperate *nc files, then read them in at the step of IETS calcuation as follows.

Code
device_configuration = nlread('filename-dc.nc', DeviceConfiguration)[0]

dynamical_matrix = nlread('filename-dm.nc', DynamicalMatrix)[0]

hamiltonian_derivatives = nlread('filename-hd.nc', HamiltonianDerivatives)[0]

inelastic_transmission_spectrum = InelasticTransmissionSpectrum(
configuration=device_configuration,
dynamical_matrix=dynamical_matrix,
hamiltonian_derivatives=hamiltonian_derivatives,
energies=numpy.linspace(0, 0, 1)*eV,
kpoints=MonkhorstPackGrid(1, 1),
qpoints=MonkhorstPackGrid(1, 1),
method=XLOE,
)
nlsave('filename-IETS.nc', inelastic_transmission_spectrum)

With best regards,

/Guangping
Title: Re: Tutorial of Inelastic electron tunneling spectrum
Post by: zhangguangping on August 13, 2016, 05:56
See http://quantumwise.com/publications/tutorials/item/877-inelastic-electron-spectroscopy-of-h-molecule-between-1d-au-chains

Dear Anders,

Before, I have used inelastica to repeat the theoretical results in PRL 104,077801(2010). And can get a very comparable result with one in that paper (please see blow).

Now I want to use ATK to repeat this result since I can fllow the tutorial you suggest me (please see the input *py file in the attachment). However, I was stucked in the step of "HamiltonianDerivatives" while the steps of "DynamicalMatrix" can be done sucessfully with a reasonable computing time.

As seen, the junction consists of a CH3-C7 molecule sandwiched bwetween to Au(111) electrodes. And periodic boundary condictions are used in x and y directions.

In the "HamiltonianDerivatives", the following settings are first used, and repetitions=(1, 1, 1) is used to save computational time.

Code
# -------------------------------------------------------------
# Hamiltonian Derivatives
# -------------------------------------------------------------
hamiltonian_derivatives = HamiltonianDerivatives(
    configuration=device_configuration,
    repetitions=(1, 1, 1),
    atomic_displacement=0.01*Angstrom,
    constraints=[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, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169],
    use_equivalent_bulk=True,
    )
nlsave('CH3-C7-Au-IETS.nc', hamiltonian_derivatives)

However, errors occur. And it suggests me increase the unit cell repetition in the direction.

Code
Traceback (most recent call last):
  File "/tmp/1366.node00/CH3-C7-Au-IETS.py", line 463, in <module>
Traceback (most recent call last): 
  File "/tmp/1366.node00/CH3-C7-Au-IETS.py", line 463, in <module>
Traceback (most recent call last):
  File "/tmp/1366.node00/CH3-C7-Au-IETS.py", line 463, in <module>
Traceback (most recent call last):
  File "/tmp/1366.node00/CH3-C7-Au-IETS.py", line 463, in <module>
    use_equivalent_bulk=True,
  File "./zipdir/NL/Analysis/HamiltonianDerivatives.py", line 132, in __init__
    use_equivalent_bulk=True,
  File "./zipdir/NL/Analysis/HamiltonianDerivatives.py", line 132, in __init__
    use_equivalent_bulk=True,
  File "./zipdir/NL/Analysis/HamiltonianDerivatives.py", line 132, in __init__
    use_equivalent_bulk=True,

  File "./zipdir/NL/Analysis/HamiltonianDerivatives.py", line 978, in setAndCheckAtomsDisplacedWithinSuperCell
  File "./zipdir/NL/Analysis/HamiltonianDerivatives.py", line 978, in setAndCheckAtomsDisplacedWithinSuperCell
  File "./zipdir/NL/Analysis/HamiltonianDerivatives.py", line 978, in setAndCheckAtomsDisplacedWithinSuperCell
  File "./zipdir/NL/Analysis/HamiltonianDerivatives.py", line 978, in setAndCheckAtomsDisplacedWithinSuperCell
NL.ComputerScienceUtilities.Exceptions.NLValueError:   File "./zipdir/NL/Analysis/HamiltonianDerivatives.py", line 978, in setAndCheckAtomsDisplacedWithinSuperCell
NL.ComputerScienceUtilities.Exceptions.NLValueError: Atoms are being displaced out of the unit cell in directions where the cell repetition is less that 3. Please increase the unit cell repetition in the direction(s): A.
NL.ComputerScienceUtilities.Exceptions.NLValueError: Atoms are being displaced out of the unit cell in directions where the cell repetition is less that 3. Please increase the unit cell repetition in the direction(s): A.
Atoms are being displaced out of the unit cell in directions where the cell repetition is less that 3. Please increase the unit cell repetition in the direction(s): A.
NL.ComputerScienceUtilities.Exceptions.NLValueError: Atoms are being displaced out of the unit cell in directions where the cell repetition is less that 3. Please increase the unit cell repetition in the direction(s): A.
NL.ComputerScienceUtilities.Exceptions.NLValueError: Atoms are being displaced out of the unit cell in directions where the cell repetition is less that 3. Please increase the unit cell repetition in the direction(s): A.
NL.ComputerScienceUtilities.Exceptions.NLValueError: Atoms are being displaced out of the unit cell in directions where the cell repetition is less that 3. Please increase the unit cell repetition in the direction(s): A.
NL.ComputerScienceUtilities.ExceptionsNL.ComputerScienceUtilities.Exceptions.NLValueError: Atoms are being displaced out of the unit cell in directions where the cell repetition is less that 3. Please increase the unit cell repetition in the direction(s): A.
.NLValueError: Atoms are being displaced out of the unit cell in directions where the cell repetition is less that 3. Please increase the unit cell repetition in the direction(s): A.

I can not understand this note "Atoms are being displaced out of the unit cell in directions where the cell repetition is less that 3." As is seen in the .py file, only the CH3-C7 molecule is not constrainedin the "HamiltonianDerivatives" calculation. And displacement of atoms of CH3-C7 by 0.01 Angstrom will not move the atom out of the unit cell. So, what does the note really mean?

As I understand, "HamiltonianDerivatives" calculation is very similar with "DynamicalMatrix" calcualtion in numerical technique. Anyway, I increase the unit cell repetition in x and y directions to 3

Code
# -------------------------------------------------------------
# Hamiltonian Derivatives
# -------------------------------------------------------------
hamiltonian_derivatives = HamiltonianDerivatives(
    configuration=device_configuration,
    repetitions=(3, 3, 1),
    atomic_displacement=0.01*Angstrom,
    constraints=[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, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169],
    use_equivalent_bulk=True,
    )
nlsave('CH3-C7-Au-IETS.nc', hamiltonian_derivatives)

However, the calcualtion can be go further, but the self-consistent calcualtion is very slow. One cycle needs more than 24 hours with 4 cores.

As I guess, the "HamiltonianDerivatives" is equivalent to the PHrun in inelastica calcualtion. And as I remember, the whole PHrun needs less than 4 hours with one core for this system.

For a similar system, I think the PHrun in inelastica read the *TSHS file generated in FCrun and does the "HamiltonianDerivatives" in the following step,
Code
Phonons.Analyze: Reading (H0,S0,dH) from .TSHS and .onlyS files:
SiestaIO.HS.__init__: Reading ../FCrun/M1-Au-FC 151   0.TSHS
Found 324 atoms, (11792, 2948) orbitals in super-, unit-cell
SiestaIO.HS.setkpoint: ../FCrun/M1-Au-FC 151   0.TSHS k = [ 0.  0.  0.]
SiestaIO.HS.__init__: Reading ../FCrun/M1-Au-FC 151   1.TSHS
Found 324 atoms, (11792, 2948) orbitals in super-, unit-cell
SiestaIO.HS.setkpoint: ../FCrun/M1-Au-FC 151   1.TSHS k = [ 0.  0.  0.]
SiestaIO.HS.__init__: Reading ../FCrun/M1-Au-FC 151   2.TSHS
Found 324 atoms, (11792, 2948) orbitals in super-, unit-cell
...
...
...
SiestaIO.HS.setkpoint: ../FCrun/M1-Au-FC 151 143.TSHS k = [ 0.  0.  0.]
SiestaIO.HS.__init__: Reading ../FCrun/M1-Au-FC 151 144.TSHS
Found 324 atoms, (11792, 2948) orbitals in super-, unit-cell
SiestaIO.HS.setkpoint: ../FCrun/M1-Au-FC 151 144.TSHS k = [ 0.  0.  0.]
Phonons.CorrectdH: Applying correction to dH...

I guess the repetitions=(3, 3, 1) leads to the huge increase in the computational effort.

Also, I see there will be k-points sampling in the "HamiltonianDerivatives" calculation if use_equivalent_bulk is set to True. However, I did not find where to set the k-points sampling in Class HamiltonianDerivatives. Does it share the same with "DeviceLCAOCalculator"? If yes, can I have different k-points sampling for them?

Finally, I saw "use_equivalent_bulk" parameters in "HamiltonianDerivatives" and "DynamicalMatrix" to decide whether the DeviceConfiguration should be treated as a BulkConfiguration. As I understand, if it is set to True, the number of atoms in "HamiltonianDerivatives"  should equal to that of central region in DeviceConfiguration. But in my case, the number in the output file equals to central region + two electrodes. That is, the number of atoms in two electrode are counted by twice, which would increase the computational burden.

Did I  make some misunderstanding of the calcualtions or give wrong settings in ATK for IEST.

Can you please give me some suggesions?

With best regards.

/Guangping
Title: Re: Tutorial of Inelastic electron tunneling spectrum
Post by: Anders Blom on August 15, 2016, 12:45
Lots of questions, I got a bit lost. Let's treat them one by one, rather :)

Yes, it's enough to do 1x1 for a molecule like this. Also for the repetitions.

The problem about "outside the cell" seems to be a bug, of sorts. But I think a better solution is to not use a hexagonal cell in A/B. When you cleave the gold, make a supercell so that the surface cell is rectangular instead. That should get rid of this problem, and you can proceed (without the need for repetitions).
Title: Re: Tutorial of Inelastic electron tunneling spectrum
Post by: Anders Blom on August 15, 2016, 12:53
Hm, that might not be enough to work around the bug. Actually, the real problem appears to be that some Gold atoms are outside the cell (which normally is perfectly ok). If you "wrap" all atoms (esp. in X/Y), I think you should be fine.
Title: Re: Tutorial of Inelastic electron tunneling spectrum
Post by: zhangguangping on August 15, 2016, 15:20
Lots of questions, I got a bit lost. Let's treat them one by one, rather :)

Yes, it's enough to do 1x1 for a molecule like this. Also for the repetitions.

The problem about "outside the cell" seems to be a bug, of sorts. But I think a better solution is to not use a hexagonal cell in A/B. When you cleave the gold, make a supercell so that the surface cell is rectangular instead. That should get rid of this problem, and you can proceed (without the need for repetitions).

Good to know that this is bug. I think hard to understand this, but failed.

Does this bug fixed in 2006.0? I now use 2005.1.

Thanks very much.

/Guangping
Title: Re: Tutorial of Inelastic electron tunneling spectrum
Post by: Anders Blom on August 15, 2016, 15:47
No, it will be fixed in 2016.2 (or maybe 2016.1). But you don't have to wait for that, just wrap the atoms so there are no negative fractional coordinates for any atoms, and you should be fine.
Title: Re: Tutorial of Inelastic electron tunneling spectrum
Post by: zhangguangping on August 15, 2016, 16:33
No, it will be fixed in 2016.2 (or maybe 2016.1). But you don't have to wait for that, just wrap the atoms so there are no negative fractional coordinates for any atoms, and you should be fine.

You mean, when I do the "HamiltonianDerivatives", I can remove the electrode atoms. And the results will match thoes of ”DynamicalMatrix“ and DeviceConfiguration as well as can give a correct IETS results?

Thanks so much.

/Guangping
Title: Re: Tutorial of Inelastic electron tunneling spectrum
Post by: zhangguangping on August 15, 2016, 16:33
No, it will be fixed in 2016.2 (or maybe 2016.1). But you don't have to wait for that, just wrap the atoms so there are no negative fractional coordinates for any atoms, and you should be fine.

You mean, when I do the "HamiltonianDerivatives", I can remove the electrode atoms I constrained. And the results will match thoes of ”DynamicalMatrix“ and DeviceConfiguration as well as can give a correct IETS results?

I tried to tanslate my system by a bit to aviod negative fractional coordinates for all the atoms (although there are some fractional coordindates larger than 1). and rerun this job, but it still failed. Any suggestion?

Thanks so much.

/Guangping
Title: Re: Tutorial of Inelastic electron tunneling spectrum
Post by: Anders Blom on August 15, 2016, 17:10
No, that's not what I mean. Before you construct the device, you need to ensure that all atoms have positive fractional positions. So, go back to the Builder, remove the electrodes (convert to bulk, by the button) and use Bulk Tools>Wrap. Then again make electrodes, and you should have a configuration that does not give this error.
Title: Re: Tutorial of Inelastic electron tunneling spectrum
Post by: zhangguangping on August 15, 2016, 18:13
No, that's not what I mean. Before you construct the device, you need to ensure that all atoms have positive fractional positions. So, go back to the Builder, remove the electrodes (convert to bulk, by the button) and use Bulk Tools>Wrap. Then again make electrodes, and you should have a configuration that does not give this error.

Dear Blom,

As I have attached the input file, I am sure there is no atoms with negative fractional coordinates. But the code gave the very same errors.

Can you please inspect this?

With best regards,

/Guangping
Title: Re: Tutorial of Inelastic electron tunneling spectrum
Post by: Anders Blom on August 15, 2016, 21:00
Well, now you have the opposite problem, you have atoms with fractional coordinates > 1. Using wrap would have gotten rid of these also.
Title: Re: Tutorial of Inelastic electron tunneling spectrum
Post by: zhangguangping on August 18, 2016, 02:57
Well, now you have the opposite problem, you have atoms with fractional coordinates > 1. Using wrap would have gotten rid of these also.

Thanks for your reply. Aha, I get your point! Now it seems working.
Good to have you in the forum to guide ATK users.

I saw for IETS calculation, there are 4 main calculations:
(1) a two probe junction calculation: DeviceLCAOCalculator;
(2) force constant calculation: DynamicalMatrix;
(3) derivative of Hmiltonian: HamiltonianDerivatives;
(4) last, the IETS calculation based on (1)-(3): InelasticTransmissionSpectrum.

I find the steps (2) and (3) are time demanding.  And I think these two calcuations can share the same SCF consistent results for each displacement of degree. For example, if there are 26 atoms not constrained in the system, there will be 26*3*2=156 SCF consistent steps of electronic structure. For each step, the DynamicalMatrix uses total enegy and HamiltonianDerivatives uses Hamiltonian to do a finite difference. Therefore, they can share the SCF process. But, As I inspect from the out file, I see they do their own  SCF consistent calcuations respectively, which will nearly double the calcuation time. Is there any method or flag to combined them together since they are both needed in IETS calculation? In inelastica code, the code save each Hamiltonian files on the disk, and then do a read in, which is much fast than calculation from scratch. Maybe, ATK can give such flags in DynamicalMatrix Class that indicates the code save Hamiltonian into nc files or so.

However, for steps (2) and (3), I can not find entry for k-point sampling. I guess they use the same k-sampling as in (1), that is use the one for the device equivlent bulk.
Code
device_numerical_accuracy_parameters = NumericalAccuracyParameters(
    k_point_sampling=(4, 4, 20),

Is it possible that I use only Gamma point in steps (2) and (3) to save computaional time? Or they must be the exactly same as that in (1) for (2) and (3)?

If the answer is yes, I must sepertate the calculation of (2) and (3) from (1), where there is only a Gamma k-point sampling for (1) in the *py file for (2) and (3) since (2) and (3) do not have their own entry for k-point sampling and use the one as in (1).

Thanks very much.

/Guangping
Title: Re: Tutorial of Inelastic electron tunneling spectrum
Post by: Troels Markussen on August 19, 2016, 09:59
Hi,

You are right that the HamiltonianDerivatives and DynamicalMatrix calculations could share the same scf results. This is something we have planned to implement, but we have not done it yet.

Regarding the k-point sampling for HamiltonianDerivatives and DynamicalMatrix: This does not have to be the same as for the device calculation, step (1). In fact, if the system is repeated in any direction (either set manually or done automatically) you should always reduce the number of k-point in that direction correspondingly. Otherwise the calculations will become too heavy. So you are right, that you should setup a separate calculator for the HamiltonianDerivatives and DynamicalMatrix calculations.

Note that you can get the automatically detected repetition with the function
(nA,nB,nC) = checkNumberOfRepetitions(configuration)
before you run the HamiltonianDerivatives and DynamicalMatrix calculations.

Troels
Title: Re: Tutorial of Inelastic electron tunneling spectrum
Post by: zhangguangping on August 19, 2016, 14:47
Hi,

You are right that the HamiltonianDerivatives and DynamicalMatrix calculations could share the same scf results. This is something we have planned to implement, but we have not done it yet.

Regarding the k-point sampling for HamiltonianDerivatives and DynamicalMatrix: This does not have to be the same as for the device calculation, step (1). In fact, if the system is repeated in any direction (either set manually or done automatically) you should always reduce the number of k-point in that direction correspondingly. Otherwise the calculations will become too heavy. So you are right, that you should setup a separate calculator for the HamiltonianDerivatives and DynamicalMatrix calculations.

Note that you can get the automatically detected repetition with the function
(nA,nB,nC) = checkNumberOfRepetitions(configuration)
before you run the HamiltonianDerivatives and DynamicalMatrix calculations.

Troels

Dear Troels,

Thanks for your kind reply.

By the way, I think you should belong to the "QuantumWise Staff" group, not "New ATK user". The explicit indication would make your answer more convincing.

With best.

/Guangping