Skip to content
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

Metric tensor plugin for VoronoiBinMapper #3

Open
synapticarbors opened this issue Oct 4, 2014 · 0 comments
Open

Metric tensor plugin for VoronoiBinMapper #3

synapticarbors opened this issue Oct 4, 2014 · 0 comments
Labels
enhancement For PRs and issues that would enhance WESTPA user experience

Comments

@synapticarbors
Copy link
Member

Migrated from Redmine Issue Tracker

Author: @synapticarbors
Date: 2/22/2013

Description

Currently there is no general facility for calculating the metric tensor associated with a set of progress coordinates, which are needed to properly calculate distances for the VoronoiBinMapper. Up until now, the working assumption has been that the progress coordinates were either in cartesian space or a linear transform thereof. This is not going to be generally true (e.g. mixing distances with dihedral angles, etc). This feature is important for both general use of the VoronoiBinMapper and specifically for the String Method plugin.

I propose implementing a plugin that calculates the metric tensor, M, assuming that M is constant, as is done in Vanden-Eijnden and Venturoli (2009) JCP 130, 194103. This should be called prior to a WE update, at which time it updates the estimate of M and updates the VoronoiBinMapper's custom arguments that are passed to the distance metric function dfunc. The user will be responsible for applying the metric tensor properly when calculating the distance to a Voronoi Center.

This sounds like a great idea.

Investigating this further, it looks like it might make sense to wrap the PLUMED code (http://www.plumed-code.org/) that defines a large number of collective variable types and their analytic first derivatives. It's written in C, so hopefully it would be simple to wrap using Cython. There is actually already a python interface that uses ctypes, but it doesn't expose exactly what we would need to calculate the metric tensor. Users could then just define their progress coordinates using the input file specification that PLUMED parses. PLUMED is LGPL so I need to figure out what the restrictions are for packaging it or part of its source, or if it needs to be specified as a requirement and then linked into the correct place to build the plugin.

Also as a correction to my original issue, the working assumption has been that the progress coordinates were either in cartesian space or an invariant transform thereof.

Sounds good. It's very likely that WESTPA will be (L)GPL in the end, so there should be no problem packaging PLUMED, at least for convenience. Failing that, a HOWTO on downloading PLUMED and getting the plugin compiled would probably not be too bad.

@synapticarbors synapticarbors added the enhancement For PRs and issues that would enhance WESTPA user experience label Oct 4, 2014
ltchong pushed a commit that referenced this issue Aug 21, 2015
Converted Alex's style guide to sphinx
synapticarbors pushed a commit to synapticarbors/westpa that referenced this issue Jun 24, 2020
Converted Alex's style guide to sphinx

Former-commit-id: 2d2cbcb
jeremyleung521 added a commit that referenced this issue Mar 26, 2021
)

* added pull templates and issues templates

* removed westpa 2.0 workflows

* small fix to a potential bug in kinetics_tool

* Update README.rst

* Fixed a bug caused by bytestring when reading the basis state filename from west.h5

* Revert "Merge pull request #3 from westpa/main"

This reverts commit 7257846, reversing
changes made to b13b32a.

* documentation changes

* minor change`

* Update src/westpa/core/h5io.py

Changed based on review.

Co-authored-by: Jeremy Leung <63817169+jeremyleung521@users.noreply.github.com>

Co-authored-by: Jeremy Leung <jeremyleung521@gmail.com>
Co-authored-by: Jeremy Leung <63817169+jeremyleung521@users.noreply.github.com>
Co-authored-by: She Zhang <she.zhang@eyesopen.com>
Co-authored-by: Lillian Chong <ltchong@pitt.edu>
jdrusso pushed a commit that referenced this issue Sep 13, 2021
jdrusso pushed a commit that referenced this issue Sep 13, 2021
This reverts commit 7257846, reversing
changes made to b13b32a.
jeremyleung521 added a commit that referenced this issue Dec 6, 2021
* Moved initialization functionality out of w_init entry_point, and removed mock.patch usage from test.

* Refactored simulation logic out of w_run.entry_point() and updated test

* Updated TestArgs object to auto-populate attributes from kwargs

* Updated test_w_assign to not use mock.patch

* Refactored initialization logic out of w_states entry_point

* Refactored w_states test to remove mock.patch usage

* Refactored MockArgs class into common.py

* Refactored w_succ to remove mock.patch usage

* Removed unnecessary arguments

* Added support for Start States

* Added start-state functionality

* Initial commit of restarting plugin driver

* Updated __init__.py so WESTPA can find restarting plugin

* Explicitly close the h5 file after initializing  a simulation

* Various bugfixes. Added WE segment weight tracking, model logging, and full initialization/restart. Sorry for the megacommit..

* Changed msm_we import to not use hard-coded path

* Added code to monkey-patch in user overrides to process and reduce coordinates

* Fixed indexing the stationary distribution of a cleaned flux matrix

* Sample overrides for processCoordinates() and reduceCoordinates()

* Added functionality to support multiple independent runs per restart

* Patch to correct h5py occasionally reading strings as bytestrings

* Minor logging changes. Logic change to exit before initializing new on last run.

* Added sample config and  re-initialization files

* Minor documentation added

* Changed logic to build haMSM from ALL restarts, not just previous.

* Updated w_init test to pass sstate parameter (but None) + updated reference h5

* Correctly use h5io.tostr to read basis_auxref for initial states to handle bytes types returned by h5py

* Handle the right exception for h5 coordinates already existing

* Add support for specifying output structure filetype in config

* Moved reduceCoordinates back from overrides into msm_we and removed monkey-patching for reduceCoordinates

* Added squeeze to fix issue with pSS returned as nested array

* Handle structure types that don't define unit cell angles and lengths

* Correctly handle different filetypes

* Fix to amber restartfile writing

* Fixed extensions for start-state files

* Cleaned up documentation, and replaced file_specifier parameter with read from data_manager.

* Added necessary .wait() back to post-restart w_run invocation

* Changed slow shutil.copy to shutil.rename so moving traj_segs doesn't take hours

* Finally fixed pSS return type, and corrected shutil.rename to os.rename

* Create traj_segs and seg_logs for new restart

* Added sphinx documentation for haMSM restarting plugin

* Swapped out subprocess.popen(run.sh) calls to w_run.run_simulation()

* Added workaround for duplicate plugin loading. See issue #182 on github

* Documentation about choice of work manager for restarting

* Recreate traj_segs and seg_logs after moving

* Pickle with protocol 4 to support large haMSM objects

* Added documentation status to README.rst

* begin converting string method plugin to westpa 2.0

* Fix string method hash to check as bytes

* Changed default logging settings

* Updated to specify target/basis states as boundaries.

* Refactored kludgey logic,  and cleaned up w_init.initialize() calls using **expansion

* Handle deprecated old-style initialization JSON

* If the target path already exists for traj_segs or seg_data, overwrite it

* Overwrite existing traj_segs or seg_logs

* Use get_coordSet instead of manually doing the same thing

* Fixed exiting too early on final restart

* Remove some extraneous comments

* Added docstring for filename in prepare_coordinates

* Only do type-conversion from matrix to array on pSS if it's actually an np.matrix

* Removed unused initPDBfile

* Cleaned up some output and logging

* Added a config option to use the last N iterations for model-building

* Fixed logging to properly use Rich

* Changed some log levels to be more reasonable

* Changed initialization JSON to be moved right before the new restart is initialized. Otherwise, if it  crashes, it's  already been moved and has to be copied back before restarting

* Added optional debug output flag to plugin config

* Added some documentation on continuing failed runs

* Remove parameter  reference that will no longer exist  in modelWE

* Changed logic for unitcell check to be more robust

* Updated plugin with tau parameter

* Pickle clusters again

* Corrected a comment in the sample cfg

* Comments outlining extension protocol when no target flux is reached

* Added function to check if target state was reached  in an h5 file

* Added code to continue all runs by a certain number of iterations if target is not reached

* Added documentation for extension_iters

* Swapped loglevel back from debug to info

* Swap to using improved eigensolver

* Swap to using improved eigensolver

* Bugfixes

* Don't do extensions if extension_iters == 0

* Default extension to off

* Always use all iterations in the h5

* Added documentation for extension iters

* Remove last_iter argument, always use max iters

* Remove west_original_length.cfg if it already exists during the first run

* Corrected west cfg backup removal in first run

* Fixed issues with state and extensions

* Changed to symlink for extensions instead of copying many files

* Fixed incorrect structure weight calculation

* is_last_iteration now checks if it's the last, or past the last in case of extensions

* Corrected assertion exception message

* Correct normalization check to work  for equilibrium systems without basis/target states

* Fixed  test

* Fix for states.as_numpy_record

* Added support for multidimensional progress coords -- NOT backwards compatible

* BREAKING: Fully removed support for old target/basis pcoord specification formats

* Fix: Correctly read parameter for multidimensional pcoords and pass to msm_we

* Removed unused line with invalid syntax

* Added option for doing streaming clustering

* Bugfix: Checking unset bounds now done correctly

* Bugfix: Normalization check

* Removed unnecessary modifications to west.cfg for extensions

* Updated calls to msm_we to conform to most recent version and avoid deprecation warnings

* Changed log error to info on traj_segs overwrite

* Bugfix: fixed extra tau in call to model.initialize()

* Remove last reference to west_original_length.cfg

* Fix bounds for collectCoordinates --  infs assumed pcoord dimensionality

* Provide some more output when checking if target has been reached

* Explicitly exclude states in the target/basis

* Merge in branch 'ray', including rebase on latest westpa

* Merge branch 'westpa_main_2.0' into to_merge

* Do block validation and produce plots during restarting

* Ensure flux plot text isn't cut off

* Bugfix: Write pseudocommittor plot

* Move plotting to own function

* Disable buggy 'sanity' check

* Allow specifying a temp directory for Ray

* Added probability output for start-states

* Explicitly renormalize after w_init if necessary

* Provide a reassuring message about rescaling

* Add n_cpus to sample west.cfg

* Remove mdtraj from extras_require

* Change to plot legend formatting

* Don't add legend entries for 0 flux

* Add notice about pseudocommittor, and show raw flux values in legendf

* black-reformatted

* Fix sample restarting plugin config

* hamsm restarting plugin documentation fix (#3)

* Updated haMSM plugin documentation

Co-authored-by: John Russo <russojd@.ohsu.edu>
Co-authored-by: Jeremy Leung <63817169+jeremyleung521@users.noreply.github.com>
Co-authored-by: Joshua L. Adelman <joshua.adelman@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement For PRs and issues that would enhance WESTPA user experience
Projects
None yet
Development

No branches or pull requests

1 participant