question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

k2gamma assertion error: complex MO coefficients

See original GitHub issue

There are several points in the k2gamma code (specifically in the mo_k2gamma function) where there are assertions with no description of what causes the issue or how to resolve it. Mostly these are related to matrices that should be real, having significant imaginary components. When I come across one of these assertion errors, what should I do to reduce the errors so that my system/calculation can pass the assertion?

Here is an example that triggers an assertion error:

from pyscf.pbc import scf
from pyscf.pbc.gto import Cell
import numpy as np


# ----- Construct a 1-dimensional O2 chain unit cell ----- #
cell = Cell()
cell.atom = [
    ["O", (0,0,0)],
    ["O", (2,0,0)]
]

cell.dimension = 1
cell.basis = '6-31g'
cell.a = np.eye(3)*[4,10,10]
cell.verbose = 4
cell.unit = 'A'
cell.build()

kpts = cell.make_kpts([3,1,1])

# -------- KHF calculation ------- #
mf = scf.KRHF(cell, kpts).density_fit()
e_hf = mf.kernel()


from pyscf.pbc.tools.k2gamma import mo_k2gamma
mo_k2gamma(cell, mf.mo_energy, mf.mo_coeff, mf.kpts, kmesh=None)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
tberkelcommented, Jan 11, 2022

Hi all, Another way to say Zhihao’s point: at the noninteracting level, this system is a metal (it’s equally-spaced O atoms). An RHF calculation of the supercell that Max suggested probably doesn’t converge. The converged k-point solution, which breaks lattice symmetry as Zhihao said, is a CDW insulator.

On Tue, Jan 11, 2022 at 5:58 PM Max @.***> wrote:

Okay that very interesting! I naively assumed that since the supercell calculation is more “flexible” (has fewer symmetry translations assumed), any k-point solution could also be exactly translated to a supercell solution. But I guess this is only true if you leave the orbitals complex. Thanks a lot

— Reply to this email directly, view it on GitHub https://github.com/pyscf/pyscf/issues/1161#issuecomment-1010441801, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADGAJC6M2FWEX4RFJ3EOUD3UVSYZRANCNFSM5LXGEQZA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

1reaction
zhcuicommented, Jan 11, 2022

Hi Max,

There exists a set of orbitals in the supercell describing the same occupied space, but cannot be realized.

I think we can always get a set of real orbitals from a supercell calculation, but that solution would be different from the one from the above k-point calculation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Source code for pyscf.pbc.tools.k2gamma
Convert the k-sampled MO/integrals to corresponding Gamma-point supercell ... DEBUG3: logger.debug3(cell, 'dim=%d common_denominator %d error %g', i, ...
Read more >
arXiv:2208.07343v2 [math.NT] 21 Aug 2022
This family is studied for its own interest and for applications to elliptic curves and coefficients of half integer weight modular forms. To...
Read more >
Hecke polynomials of modular groups and congruence
we are interested only in the absolute values of the zeros of the Hecke poly- nomials (cf. \S 1, Remark 2). But, of...
Read more >
pyscf Changelog - pyup.io
Fix an error when calculating grad of dft method with "HF" as xc ... Performance of semi-incore AO-MO integral transformation * Bugfix -...
Read more >
Bayesian Non-linear Statistical Inverse Problems.
1.2.2 A random design regression model with normal errors . . . . 13 ... vector fields defined on X,Z, respectively. Denote by...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found