Skip to content

Conversation

janosh
Copy link
Collaborator

@janosh janosh commented Sep 27, 2025

lots of bug fixes, type fixes, moving integrator+optimizer functions into module scope (for easier typing and easier-to-reason-about-API since no more function closures over models). this PR includes the fairchem v2 PR #238, #127 by @stefanbringuier.

fix README.md file name casing
@CompRhys
Copy link
Member

were any additional changes made beyond #127 and #211 as they exist here that would prevent us merging those separately and then looking at this afterwards?

[![This project supports Python 3.11+](https://img.shields.io/badge/Python-3.11+-blue.svg?logo=python&logoColor=white)](https://python.org/downloads)
[![PyPI](https://img.shields.io/pypi/v/torch_sim_atomistic?logo=pypi&logoColor=white)](https://pypi.org/project/torch_sim_atomistic)
[![CI](https://github.com/torchsim/torch-sim/actions/workflows/test.yml/badge.svg)](https://github.com/torchsim/torch-sim/actions/workflows/test.yml)
[![codecov](https://codecov.io/gh/torchsim/torch-sim/branch/main/graph/badge.svg)](https://codecov.io/gh/torchsim/torch-sim)
Copy link
Member

Choose a reason for hiding this comment

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

https://codecov.io/gh/torchsim/torch-sim is a broken link currently

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

tried adding codecov app to this new org. seems to have worked but then but it's not showing up for me in the web UI (yet)...

if step % 10 == 0:
hybrid_state = swap_step(hybrid_state, kT=torch.tensor(kT), generator=generator)
hybrid_state = ts.swap_mc_step(
model=model, state=hybrid_state, kT=kT, seed=42 + step
Copy link
Member

Choose a reason for hiding this comment

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

why not keep passing the same generator? reseeding is bad for entropy vs using the same prng sequence


# %% Create individual filenames for each system
filenames = [f"batch_traj_{i}.h5" for i in range(len(systems))]
filenames = [f"tmp/batch_traj_{i}.h5" for i in range(len(systems))]
Copy link
Member

Choose a reason for hiding this comment

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

nit: Do you want to auto-clean up at the end of the tutorial and delete tmp?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

better not, could be people (like myself) have other stuff in tmp/ folder which they want to keep

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

could write to a subfolder in tmp/ and clean that up instead. then only minor concern is that people might want to manually inspect the files and be annoyed if they need to comment out the removal code and rerun tutorial

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it's fine letting people clean up their own tutorials

temperatures = []
for _step in range(n_steps):
state = update_fn(state=state)
state = ts.npt_langevin_update(
Copy link
Member

Choose a reason for hiding this comment

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

feels like the refactor likely introduces a bug here in that we should be passing a generator to this update function?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i don't follow. you mean we need to externally seed?

noise = torch.randn_like(state.cell_positions, device=state.device, dtype=state.dtype)

Copy link
Member

Choose a reason for hiding this comment

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

I would think (not sure/haven't/won't check) before the init function that returned the update function would have made a generator in the factory that was used for the PRNG sequence inside the update. Here this is unseeded which is probably fine for now but would be better to fix alongside something like: #51

Copy link
Collaborator

Choose a reason for hiding this comment

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

That would have been the right way to do it but not what we did. Fixing the seeds doesn't really work on most integrators beyond init. Agree it can be addressed later.

@janosh
Copy link
Collaborator Author

janosh commented Sep 28, 2025

were any additional changes made beyond #127 and #211 as they exist here that would prevent us merging those separately and then looking at this afterwards?

for #211 no, for #127 a few minor changes to bring it inline with the new API (was still using SimState.batch instead of system_idx so wasn't working even with the prev API)

CompRhys added a commit that referenced this pull request Oct 3, 2025
CompRhys added a commit that referenced this pull request Oct 3, 2025
@orionarcher orionarcher merged commit 9151970 into main Oct 9, 2025
95 checks passed
@orionarcher orionarcher deleted the api-redesign branch October 9, 2025 12:09
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.

4 participants