Skip to content

Keep mVMC NSROptItrSmp default positive - #58

Merged
tmisawa merged 1 commit into
developfrom
fix-mvmc-sropt-smp-default
Jul 7, 2026
Merged

Keep mVMC NSROptItrSmp default positive#58
tmisawa merged 1 commit into
developfrom
fix-mvmc-sropt-smp-default

Conversation

@tmisawa

@tmisawa tmisawa commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Clamp the mVMC standard-mode default NSROptItrSmp to at least 1
    in the C StdFace implementation.
  • Apply the same default handling to the Python writer on develop.
  • Add regression coverage for NSROptItrStep = 2, where integer division
    previously produced NSROptItrSmp = 0.

Motivation

The mVMC standard-mode default for NSROptItrSmp is derived from
NSROptItrStep / 10. For short optimization runs such as
NSROptItrStep = 2, integer division made the generated modpara.def
contain:

NSROptItrSmp   0

NSROptItrSmp is documented as a positive integer, and a zero averaging
window can lead to invalid optimized-parameter output. This PR keeps the
default positive while preserving the existing default for normal runs
where NSROptItrStep >= 10.

Tests

cmake -S . -B <build-dir> -DMVMC=ON -DTestStdFace=ON -DCMAKE_POLICY_VERSION_MINIMUM=3.5
cmake --build <build-dir> -j2
ctest --test-dir <build-dir> -R HubbardChainShortSROpt --output-on-failure
ctest --test-dir <build-dir> --output-on-failure
PYTHONPATH=python pytest test/unit/test_common_writer.py -q
PYTHONPATH=python pytest test/unit -q

@tmisawa
tmisawa merged commit 8c40010 into develop Jul 7, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant