Author Topic: The problem about charge being zero in the central region has been solved.  (Read 34349 times)

0 Members and 1 Guest are viewing this topic.

postnikov

  • Guest
Re: charge becomes zero in the central region
« Reply #15 on: August 4, 2009, 15:43 »
You are right about the charge loss being a problem, but most of the time the solution is quite simple (increase the k-points sampling or the number of electrode layers).

Let us know when you get a parameter setting that works, it will, as you say, be very useful as an instructive system for other users. :)

I should also say, that when calculating a similar system, we found that you need a really high k-point sampling for the transmission spectrum to get accurate results. Therefore I'm not surprised if many k-points are also needed for the SCF loop.

In general, SingleZeta should be reserved for cases when the system uses so much memory that it's the only option, or if you have already tested a small system with this basis set and obtained accurate results. I wouldn't expect many systems to pass this test, however, the SingleZeta set is simply too limited for any serious work.


I am expecting you can give me some advice on this problem, and I am confused on this problem as other atk users.
Therefore, could you summarize the general advice for our atk users to solve this problem?

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5571
  • Country: dk
  • Reputation: 93
    • View Profile
    • QuantumATK at Synopsys
Re: charge becomes zero in the central region
« Reply #16 on: August 4, 2009, 15:55 »
There are 4 things to start with (in this order), if the calculation converges to zero charge:

  • Electrode depth. The electrodes must be deep enough, that there are only interactions with the nearest-neighbor cell. Hard to check directly, but a very common problem, I'm afraid. Future editions of ATK will work towards eliminating this problem.
  • k-point sampling. Obviously only relevant for structures that are periodic in the X/Y directions (one or both), but crucial for convergence and accuracy.
  • Temperature. Actually lowers the accuracy somewhat, but helps convergence a lot. A higher electron temperature can "mask" as a higher k-points sampling (meaning, they have the same effect, to smooth the Fermi distribution), and can thus be a cost-efficient way to get away with lower k-point sampling, which costs memory and time.
  • Mixing parameters. Lower the diagonal mixing, and change the number of mixing history steps. Sometimes more steps help, sometimes actually fewer (but not less than 4).

If the problems still persist, and you have checked that the system is periodic in the Z direction (if not, turn off the equivalent bulk calculation as use the NeutralAtom "initial density" setting), it's time for some more advanced attempts:

  • Increase the contour radius to 7-10 Ry and the number of points to 50-70.
  • Try different constraints, including the new (undocumented) one "DensityMatrix"
  • Increase the mesh cut-off. Many elements need a finer mesh than the default.

A lot of this is documented in various Forum posts, but it's a good idea to collect it. Also, most of it is described in the tutorials (see http://www.quantumwise.com/publications/tutorials), most notably the one on "Convergence Tricks" ;)

Offline zh

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 1141
  • Reputation: 24
    • View Profile
Re: charge becomes zero in the central region
« Reply #17 on: August 5, 2009, 03:14 »
Well, the second way is how VNL produces the scripts, whether the setup is homogeneous or not...!

I doubt changing the setup this way will change the convergence, but if the system is homogeneous (left electrode == right electrode), then the calculation will run faster if you set it up using the same electrode parameters, since it uses FFT rather than the multigrid method for the electrostatics.

This should be the default for homogeneous systems, but it isn't. So, you have to edit the script by hand, after VNL has provided the "template".

The second way will lead to the system being treated as a heterogeneous system and then the multigrid method is used to solve the Poisson's equation.  The experience and several failure cases suggest that it's better to do in the first way where the FFT method will be used to solve the Poisson's equation.  In some cases where the system is indeed homogeneous (i.e., the left and right electrodes are identical to each other), these two different ways for the calculation setup can not give identical results, e.g., the detailed shape and characteristics of the transmission spectrum.


« Last Edit: August 5, 2009, 03:49 by zh »

Offline zh

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 1141
  • Reputation: 24
    • View Profile
Re: charge becomes zero in the central region
« Reply #18 on: August 5, 2009, 03:32 »
...
# Set up electrodes
electrode_configuration = PeriodicAtomConfiguration(
    electrode_cell,
    electrode_elements,
    electrode_coordinates
    )

# Set up two-probe configuration
twoprobe_configuration = TwoProbeConfiguration(
    (electrode_configuration,electrode_configuration),
  ....
    )
...
two_probe_method = TwoProbeMethod(
    electrode_parameters = (left_electrode_parameters,right_electrode_parameters),
.......
)
.....

From the definition of "twoprobe_configuration", the left and right electrodes are exactly identical to each other, so it is safe to define the "two_probe_method" in the following way:
two_probe_method = TwoProbeMethod(
    electrode_parameters = (left_electrode_parameters,left_electrode_parameters),
.......
)

or
two_probe_method = TwoProbeMethod(
    electrode_parameters = (right_electrode_parameters,right_electrode_parameters),
.......
)

.
In this way, the FFT method will be used to solve the Poisson equation and it will be more safe to make the self-consistent calculations be quickly converged.


postnikov

  • Guest
Re: charge becomes zero in the central region
« Reply #19 on: August 5, 2009, 03:38 »
...
# Set up electrodes
electrode_configuration = PeriodicAtomConfiguration(
    electrode_cell,
    electrode_elements,
    electrode_coordinates
    )

# Set up two-probe configuration
twoprobe_configuration = TwoProbeConfiguration(
    (electrode_configuration,electrode_configuration),
  ....
    )
...
two_probe_method = TwoProbeMethod(
    electrode_parameters = (left_electrode_parameters,right_electrode_parameters),
.......
)
.....

From the definition of "twoprobe_configuration", the left and right electrodes are exactly identical to each other, so it is safe to define the "two_probe_method" in the following way:
two_probe_method = TwoProbeMethod(
    electrode_parameters = (left_electrode_parameters,left_electrode_parameters),
.......
)

or
two_probe_method = TwoProbeMethod(
    electrode_parameters = (right_electrode_parameters,right_electrode_parameters),
.......
)

.
In this way, the FFT method will be used to solve the Poisson equation and it will be more safe to make the self-consistent calculations be quickly converged.



Thanks! The input file has been changed

Offline zh

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 1141
  • Reputation: 24
    • View Profile
Re: charge becomes zero in the central region
« Reply #20 on: August 5, 2009, 03:56 »
Wish this hint to solve your problem. Actually, I have also encountered this kind of problem before. Sometimes, tuning the k-point grid, basis set or other parameters may not work, although these parameters are indeed important for the safe convergence of self-consistent calculation. 

postnikov

  • Guest
Re: charge becomes zero in the central region
« Reply #21 on: August 5, 2009, 09:29 »
Anders Blom, the problem has still not been solved.

1) About the Electrode depth, in this case, the unit cell is four zigzag periods and it should be deep enough;
2) As for k-point sampling, the K-Point (x, y, z) has been varied in the range (1,1,100),(10,1,100),(10,1,200),(16,1,200).
So, I think the K-P should be enough, especially in case of (16,1,200)
3) As to Temperature, I have tried two cases. One is 300K, the other is 500K.
4) For Mixing parameters, the diagonal_mixing_parameter has changed into 0.05, and the history_steps is 6.
5) About contour parameters, the contour radius is set as 6, or 7, or 10 Ry, and the number of points is varied from

50 to 70.
6) About the mesh cut-off, 150 Ry is always adopted. I think it should be enough.
7) As to the FFT method, zh's advice is adopted.
8) The SZP basis has also used.

However, the problem is still not solved.
The charge is always changed into about zero in the 2nd or 3rd step of two-probe part caculation.

It is very strange!!!!

Any more advice ??

Moderator edit: Cleaned up stray bb codes
« Last Edit: August 5, 2009, 10:51 by Anders Blom »

Offline zh

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 1141
  • Reputation: 24
    • View Profile
If possible, could you pass your script file to me  and let me check it? Did you tune the "electrode_constraint" in the "twoProbeAlgorithmParameters()"? Please see the explanation on the "twoProbeAlgorithmParameters()" in manual here:
http://www.quantumwise.com/documents/manuals/ATK-2008.10/ref.twoprobealgorithmparameters.html

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5571
  • Country: dk
  • Reputation: 93
    • View Profile
    • QuantumATK at Synopsys
I agree most parameters appear to be well chosen.

However, the coordinates are still outside the unit cell, which is never a good idea.

As for increasing the temperature, 300 or 500 K is just about the same; normally, it takes 1200 to 2000 to get an effect from this parameter.

postnikov

  • Guest
I agree most parameters appear to be well chosen.

However, the coordinates are still outside the unit cell, which is never a good idea.

As for increasing the temperature, 300 or 500 K is just about the same; normally, it takes 1200 to 2000 to get an effect from this parameter.


OK, I will move the coordinate origin and test again.

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5571
  • Country: dk
  • Reputation: 93
    • View Profile
    • QuantumATK at Synopsys
One other thing, not really related to the convergence itself, but still worth considering.

In a sense you have a too large system. Since it's periodic in the X direction, you only need to include one period in this direction, that is 4 atom layers. This reduces the number of atoms but a factor of 3, and since most numerical things in ATK scale as N^3 with the number of atoms N, this could mean a reduction in calculation time of an order of magnitude or more.

Perhaps you are preparing for running ribbons etc later, but as long as you're trying to figure the parameters out, using a smaller system will make the calculations go that much faster, thus saving yourself a lot of time in this test phase.

Note that decreasing the cell size requires a large k-point sampling, so perhaps now 30-40 k-points in X will be needed. However,
a) the calculation time only scales linearly in k-points, so you still win a lot, and
b) the calculation is parallelized over the k-point but not over geometry, so replacing atoms by k-points mean a large advantage when running in parallel

postnikov

  • Guest
One other thing, not really related to the convergence itself, but still worth considering.

In a sense you have a too large system. Since it's periodic in the X direction, you only need to include one period in this direction, that is 4 atom layers. This reduces the number of atoms but a factor of 3, and since most numerical things in ATK scale as N^3 with the number of atoms N, this could mean a reduction in calculation time of an order of magnitude or more.

Perhaps you are preparing for running ribbons etc later, but as long as you're trying to figure the parameters out, using a smaller system will make the calculations go that much faster, thus saving yourself a lot of time in this test phase.

Note that decreasing the cell size requires a large k-point sampling, so perhaps now 30-40 k-points in X will be needed. However,
a) the calculation time only scales linearly in k-points, so you still win a lot, and
b) the calculation is parallelized over the k-point but not over geometry, so replacing atoms by k-points mean a large advantage when running in parallel


I have two questions about this post.

1) As you know, the approx. in the atk code requires the unit cell should be large enough to avoid the next neighboring interaction. Then, in my opinion, the size of unit cell in the x, y, and z direction should be enough. Are my understanding right?

2)Even, in such a test case, the unit cell size in the x direction can be reduced corresponding, however if I want to deal with such a big (or more big ) system as this case, how can I solve such a charge missing problem?

By the way, I will move the coordinate origin as you adivced.

Many thanks for your and zh's help!
« Last Edit: August 5, 2009, 11:21 by postnikov »

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5571
  • Country: dk
  • Reputation: 93
    • View Profile
    • QuantumATK at Synopsys
1) The overlap condition you mention only applies in the Z direction! In XY ATK uses normal periodic boundary conditions, but in Z the special open boundary conditions lead to the requirement of non-overlap beyond the next cell.

2) I doubt the origin of the non-convergence problem is related to the X/Y directions, it's something to do with the transport in Z. So reducing the cell you just save time while figuring out the proper parameters. Moreover, if you later move to ribbons, these are anyway terminated in the X direction too, so you will then only need 1 k-point there too.


postnikov

  • Guest
If possible, could you pass your script file to me  and let me check it? Did you tune the "electrode_constraint" in the "twoProbeAlgorithmParameters()"? Please see the explanation on the "twoProbeAlgorithmParameters()" in manual here:
http://www.quantumwise.com/documents/manuals/ATK-2008.10/ref.twoprobealgorithmparameters.html


Hi, ZH, do you check it? What is your checking result?

Offline zh

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 1141
  • Reputation: 24
    • View Profile
Sorry, I did not get your input script file.