Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
optimize screen print
  • Loading branch information
hongzhouye committed Jan 11, 2024
commit ad71a565a40ed1a392e71461a16f2cefa978bf40
2 changes: 2 additions & 0 deletions pyscf/mp/mp2.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ def make_fno(mp, thresh=1e-6, pct_occ=None, nvir_act=None, t2=None):
n,v = numpy.linalg.eigh(dm[nocc:,nocc:])
idx = numpy.argsort(n)[::-1]
n,v = n[idx], v[:,idx]
numpy.set_printoptions(threshold=nmo)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be added as an option to log since this is about how the logging should be done and might apply to other parts of pyscf? Or is this a special case?

logger.debug1(mp, 'make_fno: noon = %s', n)

if nvir_act is None:
Expand All @@ -238,6 +239,7 @@ def make_fno(mp, thresh=1e-6, pct_occ=None, nvir_act=None, t2=None):
pct_occ_sum = numpy.cumsum(n/numpy.sum(n))
logger.debug1(mp, 'make_fno: pctsum(noon) = %s', pct_occ_sum)
nvir_act = numpy.count_nonzero(pct_occ_sum<pct_occ)
numpy.set_printoptions(threshold=1000)

if nvir_act == 0:
logger.warn(mp, 'make_fno: nvir_act = 0')
Expand Down
2 changes: 2 additions & 0 deletions pyscf/mp/ump2.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ def make_fno(mp, thresh=1e-6, pct_occ=None, nvir_act=None, t2=None, eris=None):
n,v = numpy.linalg.eigh(dm[nocc:,nocc:])
idx = numpy.argsort(n)[::-1]
n,v = n[idx], v[:,idx]
numpy.set_printoptions(threshold=nmo)
logger.debug1(mp, 'make_fno: noon = %s', n)

if nvir_act is None:
Expand All @@ -310,6 +311,7 @@ def make_fno(mp, thresh=1e-6, pct_occ=None, nvir_act=None, t2=None, eris=None):
pct_occ_sum = numpy.cumsum(n/numpy.sum(n))
logger.debug1(mp, 'make_fno: pctsum(noon) = %s', pct_occ_sum)
nvir_act = numpy.count_nonzero(pct_occ_sum<pct_occ)
numpy.set_printoptions(threshold=1000)

if nvir_act == 0:
logger.warn(mp, 'make_fno: nvir_act = 0')
Expand Down