MCDC icon indicating copy to clipboard operation
MCDC copied to clipboard

iQMC Batch Method

Open spasmann opened this issue 1 year ago • 3 comments

Description

The primary goals of this PR are to i) implement a randomized-QMC batching method for eigenvalue calculations ii) continue to increase the readability and maintainability of iQMC. Users can now specify an iQMC run mode with mode='fixed' or mode='batched' in the iQMC input settings, which toggles between the fixed seed and randomized-QMC batch methods. Additionally, the user can specify the sample_method and choose between either 'halton' or 'random'. Both sample methods can be used in either fixed seed or batched mode. halton refers to the halton sequence (standard and randomized) random refers to typical prng samples, which are currently generated with numpy.

The randomized-QMC batching method uses the randomized halton sequence to accumulate batch statistics in much the same way as batched Monte Carlo eigenvalue calculations. In fixed seed mode the change in the source strength every iteration comes only from convergence towards the solution. Whereas in batched mode the change in source strength is due to convergence towards the solution and some stochastic noise introduced from randomizing the samples. As a result, iQMC tallies now have a mean, sdev, and bin components like standard Monte Carlo tallies.

Additional Changes:

  • Removed nested power iteration capabilities, the flattened power iteration is now the only iQMC eigenmode solver.
  • Reorganization of iqmc_kernel.py and iqmc_loop.py, grouping functions by operation.
  • Renaming of a several variables which had shorthand names to longer and more detailed names to increase readability.
  • Addition of a iqmc_validate_inputs() function to validate the iQMC input settings.
  • allreduce_array() function added to kernel.py
  • Moved make_type_score() to be a global function in type_.py to be accesses by both Monte Carlo and iQMC scores.
  • Updated iQMC regression test and examples input decks to reflect the new changes.

Planned Work

  • [ ] Add batch method regression tests.
  • [ ] Remove "iqmc_" prefix from iqmc_kernel.py functions.
  • [ ] Replace numpy prng sampling, used when sample_method='random', with MCDC's rng functionality.

spasmann avatar Aug 09 '24 17:08 spasmann

In fixed source mode the change in the source strength every iteration comes only from convergence towards the solution. Whereas in batched mode the change in source strength is due to convergence towards the solution and some stochastic noise introduced from randomizing the samples. As a result, iQMC tallies now have a mean, sdev, and bin components like standard Monte Carlo tallies.

Do you mean "fixed seed mode", @spasmann?

ilhamv avatar Aug 13 '24 14:08 ilhamv

Thank you @jpmorgan98 ! I've added the theory guide to my todo list.

Yes, fixed seed not fixed source. Thanks, @ilhamv.

spasmann avatar Aug 13 '24 14:08 spasmann

All tests passing! @ilhamv

spasmann avatar Aug 13 '24 17:08 spasmann