-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Line calculations errors for one-dimensional graphene nanoribbons #113
Comments
The reason for this error is that the As for inspecting the results of your calculation, since it is a 1D calculation it will have only a single set of WCC, or one sum of WCC. You can access the WCC as print(result_0.wcc) or the sum of WCC as print(result_0.pol) I'm not intimately familiar with the GNR paper, but suspect it's a different kind of Z2 invariant to the Kane-Mele one. One possibility is that the sum of WCC is quantized to be either 0 or 0.5, which also produces a Z2 invariant. |
Thank you for the solution. I deleted the plot part and printed the WCC result directly. The tasks are running successfully and I got the following results: For the first GNR: INFO: Saving line result to file ./results/res_0.json +----------------------------------------------------------------------+ For the second GNR: INFO: 0 of 1 line convergence criteria fulfilled. +----------------------------------------------------------------------+ Accordingly, the sum of WCC for the first and second one is 0.0384 and 0.974, respectively. However, according to the literature (Phys. Rev. Lett. 2017, 119, 076401), the Z2 invariant for the first one and second one should be 1 and 0. That makes me confused. Is it because of the unit cell of the GNR structures or other problems about scf/nscf calculations? |
Looking at the literature you refer to, the sum of WCC should be either 0 or 0.5 (because Z2Pack normalizes the values to 1; this corresponds to the 0 or pi values of the paper). This quantization of the sum of WCC is not universal, but enforced by symmetry. So there are a few things that could go wrong here:
|
Thank you for the reply. Regarding your suggestions, I repeated several calculation tasks. However, there are still many problems.
So would you mind helping me to check these GNRs? I can send the cif files to your e-mail. Thank you very much in advance. |
It's completely expected that the calculation wouldn't work for arbitrary
This depends on the DFT code. For Quantum ESPRESSO, symmetries are usually determined automatically if the input structure includes them (QE will report the symmetries it uses).
Yes, that should be unproblematic.
No, I don't generally offer this level of support outside of paid consultancy. |
Thank you very much for your reply. It is really helpful and important for me. In recent days I have carefully read the Z2Pack book chapter and learned a lot. Now the PW2WANNIER tasks can run successfully. I fully understand that you cannot provide us the results checking. But I still have some questions, maybe you can give me some suggestions.
Thank you very much in advance. |
If there are 60 occupied bands, you should set In other words, the Wannier90 calculation should be set up such that only the desired target bands are included in the calculation. |
Thank you for the quick reply. I tried to set the num_wann, num_bands, and exclude_bands in the tpl_7AGNR.win to 60, 60, and 61-70. But the results are still. For the trivial and non-trivial GNR, the sum of WCC is 0.98 and 0.72, respectively. Strange to me. |
As a quick check, can you confirm that the number of WCC that are computed is also 60? |
Here is the one printout result. The number of calculated WCC is 60. Looks like no problem. [0.2063925948242325, 0.20639259523895023, 0.20928816237869502, 0.209288163927576 8, 0.21948308711423192, 0.2194830875517462, 0.23648234583352906, 0.2364823467243 4448, 0.24580792366736018, 0.2458079237875878, 0.24919258456866117, 0.2491925847 303124, 0.2561563424732872, 0.2561563433412845, 0.27231891210653736, 0.272318913 29794133, 0.28376336246632045, 0.28376336300899885, 0.2913146204226991, 0.291314 62084898024, 0.4997547021251558, 0.49975470230794966, 0.4997551607401317, 0.4997 5516082438437, 0.4997560342472227, 0.49975603437820487, 0.49975647977909204, 0.4 9975648021870156, 0.7081953773806977, 0.7081953782281507, 0.7157503861296426, 0. 715750386608657, 0.7271972107177532, 0.7271972115593123, 0.7433607590692674, 0.7 4336075955244, 0.7503171896410243, 0.7503171898511077, 0.7537053193964363, 0.753 7053194654937, 0.7630346653148834, 0.7630346663509845, 0.780032624245808, 0.7800 326243922309, 0.7902281071849484, 0.7902281077967196, 0.7931202722321626, 0.7931 202729287846, 0.9996652243930915, 0.9996652246297503, 0.9997544805832227, 0.9997 544809966081, 0.9997546504611944, 0.9997546511471436, 0.9997575068376133, 0.9997 575069004614, 0.9997594413006938, 0.9997594416667294, 0.9998538151193439, 0.9998 538158315038] |
Have you tested what happens when you reduce |
The next step in approaching this problem would be understanding exactly which symmetry should force the sum of WCC to be either 0 or 0.5, and see how this fails. For example, should there be pairs of WCC whose value have a certain relation? |
I tried to reduce the 'pos_tol' to 0.005 and 0.001 while the sum of WCC is 0.98 as the previous results. |
So you mean to check the coordination of each wannier center? This I didn't try before. Could you give more details about this? Thank you very much in advance. |
What is the symmetry that should enforce the sum of WCC to be 0 or 0.5 here? The symmetry should have some effect in terms of individual WCC. If you can see how it is broken, it might help figuring out the problem as a whole. |
Thank you for the quick reply. Regarding the symmetry, do you mean the symmetry for the unit cell such as mirror/inverse symmetry? In this work (https://pubs.acs.org/doi/abs/10.1021/acs.nanolett.8b03416), they draw the WCC for the GNR. But I don't know how to do it right now. Can you recommend some literature about this? |
In the absence of (spatial or time-reversal) symmetries, the sum of WCC can have any value. For it to be quantized, there must be some symmetry that acts in a way that only these two values are allowed. For example in https://journals.aps.org/prb/abstract/10.1103/PhysRevB.83.235401, it is time-reversal symmetry that forces the WCC on time-reversal invariant lines to come in pairs. |
Thanks for the quick reply. I will check the literature tomorrow and check my system. |
Hi,
Recently I am using the Z2pack to calculate Z2 invariant for one-dimensional graphene nanoribbons. I chose a literature-reported GNR (7-armchair GNR, Phys. Rev. Lett. 2017, 119, 076401, Z2=1). Before this, I tried the sample calculation for Bi and it is successful. However, when I tried the line calculations for the GNR, there was an error.
Here is the input file:
import os
import shutil
import subprocess
import matplotlib.pyplot as plt
import xml.etree.ElementTree as ET
import z2pack
qedir = "{0}/bin".format(os.getenv('EBROOTQUANTUMESPRESSO'))
wandir = "{0}/bin".format(os.getenv('EBROOTWANNIER90'))
mpirun = 'mpirun -np 20 '
pwcmd = mpirun + qedir + '/pw.x '
pw2wancmd = mpirun + qedir + '/pw2wannier90.x '
wancmd = wandir + '/wannier90.x'
z2cmd = (
wancmd + ' 7AGNR -pp;' + pwcmd + '< 7AGNR.nscf.in >& pw.log;' + pw2wancmd +
'< 7AGNR.pw2wan.in >& pw2wan.log;'
)
if not os.path.exists('./plots'):
os.mkdir('./plots')
if not os.path.exists('./results'):
os.mkdir('./results')
if not os.path.exists('./scf'):
os.makedirs('./scf')
print("Running the scf calculation")
shutil.copyfile('input/7AGNR.scf.in', 'scf/7AGNR.scf.in')
subprocess.call(pwcmd + ' < 7AGNR.scf.in > scf.out', shell=True, cwd='./scf')
cell = ET.parse('scf/7AGNR.xml').find('output').find('atomic_structure'
).find('cell')
unit = cell.get('unit', 'Bohr')
lattice = '\n'.join([cell.find(vec).text for vec in ['a1', 'a2', 'a3']])
with open('input/tpl_7AGNR.win', 'r') as f:
tpl_7AGNR_win = f.read()
with open('input/7AGNR.win', 'w') as f:
f.write(tpl_7AGNR_win.format(unit=unit, lattice=lattice))
input_files = [
'input/' + name for name in ["7AGNR.nscf.in", "7AGNR.pw2wan.in", "7AGNR.win"]
]
system = z2pack.fp.System(
input_files=input_files,
kpt_fct=[z2pack.fp.kpoint.qe, z2pack.fp.kpoint.wannier90_full],
kpt_path=["7AGNR.nscf.in", "7AGNR.win"],
command=z2cmd,
executable='/bin/bash',
mmn_path='7AGNR.mmn'
)
result_0 = z2pack.line.run(
system=system,
line=lambda t: [t, 0, 0],
save_file='./results/res_0.json',
load=True
)
fig, ax = plt.subplots(1, 2, sharey=True, figsize=(9, 5))
z2pack.plot.wcc(result_0, axis=ax[0])
plt.savefig('plots/plot.pdf', bbox_inches='tight')
print(
'Z2 topological invariant at kx = 0: {0}'.format(
z2pack.invariant.z2(result_0)
)
)
The error is like this:
+----------------------------------------------------------------------+
|================ |
|LINE CALCULATION |
|================ |
|starting at 2021-05-24 18:26:56,442 |
|running Z2Pack version 2.2.0 |
| |
|init_result: None |
|iterator: range(8, 27, 2) |
|line: <function at 0x7f740ba82290> |
|load: True |
|load_quiet: True |
|pos_tol: 0.01 |
|save_file: ./results/res_0.json |
|serializer: auto |
|system: <z2pack.fp._first_principl<...> object at 0x7f73fcc5fd90>|
+----------------------------------------------------------------------+
INFO: 0 of 1 line convergence criteria fulfilled.
INFO: Calculating line for N = 8
INFO: Saving line result to file ./results/res_0.json
INFO: 0 of 1 line convergence criteria fulfilled.
INFO: Calculating line for N = 10
INFO: Saving line result to file ./results/res_0.json
INFO: 0 of 1 line convergence criteria fulfilled.
INFO: Calculating line for N = 12
INFO: Saving line result to file ./results/res_0.json
INFO: 1 of 1 line convergence criteria fulfilled.
+----------------------------------------------------------------------+
| Calculation finished in 0h 6m 52s |
+----------------------------------------------------------------------+
+----------------------------------------------------------------------+
| ================== |
| CONVERGENCE REPORT |
| ================== |
| |
| PosCheck: PASSED |
+----------------------------------------------------------------------+
Traceback (most recent call last):
File "run.py", line 75, in
z2pack.plot.wcc(result_0, axis=ax[0])
File "</sw/installed/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/site-packages/de corator.py:decorator-gen-30>", line 2, in wcc
File "/home/yfu/.local/lib/python3.7/site-packages/z2pack/plot.py", line 36, i n inner
func(data, axis=axis, **kwargs)
File "/home/yfu/.local/lib/python3.7/site-packages/z2pack/plot.py", line 169, in wcc
_plot_gaps(surface_result, axis=axis, gaps=gaps, gap_settings=gap_settings)
File "/home/yfu/.local/lib/python3.7/site-packages/z2pack/plot.py", line 48, i n _plot_gaps
surface_result.t,
File "/home/yfu/.local/lib/python3.7/site-packages/z2pack/_result.py", line 35 , in getattr
return getattr(self.data, name)
File "/home/yfu/.local/lib/python3.7/site-packages/fsc/locker/_locker.py", lin e 45, in inner
return fct(self, key)
File "/home/yfu/.local/lib/python3.7/site-packages/z2pack/line/_data.py", line 70, in getattr
return super().getattribute(name)
AttributeError: 'OverlapLineData' object has no attribute 't'
It mentioned that an attribute reference or assignment fails. Looks like the 't' is not defined. Another strange thing is that the PosCheck is passed but no other detailed information. There is no error in the scf and nscf calculation tasks. I also checked the internet but didn't find a similar error. That is strange.
The text was updated successfully, but these errors were encountered: