-
Notifications
You must be signed in to change notification settings - Fork 6
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
Save Q vectors in the output file #634
base: protos
Are you sure you want to change the base?
Conversation
I get a job failure when running DCSF with SphericalQVectors. However, I'm wondering whether or not the user should be able to choose this qvector generator for DCSF. Also, I think we need to decide on what our stance on NPT simulations should be. This was brought up some time ago in #213 which mentions the issue for MSD and related jobs but there will be issues with the qvector generation which we try to fix here with the averaged unit cell. I'm wondering if we should follow dynasor (https://dynasor.materialsmodeling.org/workflow.html#limitations) and only allow for constant-volume MD simulations. |
I think that choosing to treat only constant-volume simulations is a valid decision, especially if we decide that we cannot handle volume changes fully correctly. Perhaps it could be useful to do a small internal survey at ISIS and the ILL and ask some of our known users if they ever analyse NPT trajectories. My guess is that allowing only for constant-V simulations is probably not a big loss. |
output_data : OutputData | ||
An object managing the writeout to one or many output files | ||
""" | ||
q_values = [float(x) for x in self._configuration["q_vectors"].keys()] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keys is redundant.
q_values = [float(x) for x in self._configuration["q_vectors"].keys()] | |
q_values = [float(x) for x in self._configuration["q_vectors"]] |
int(2 * hklMax[0, 0] + 1) | ||
* int(2 * hklMax[1, 1] + 1) | ||
* int(2 * hklMax[2, 2] + 1), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int(2 * hklMax[0, 0] + 1) | |
* int(2 * hklMax[1, 1] + 1) | |
* int(2 * hklMax[2, 2] + 1), | |
np.prod(2 * np.diag(hklMax) + 1, dtype=int), |
original_qvectors = instance._configuration["q_vectors"][q]["q_vectors"] | ||
except KeyError: | ||
continue | ||
print("q_vectors", original_qvectors) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leftover print
s?
self._axes["index" + str(dim_number)] = np.arange(dim_length) | ||
self._axes_units["index" + str(dim_number)] = "N/A" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self._axes["index" + str(dim_number)] = np.arange(dim_length) | |
self._axes_units["index" + str(dim_number)] = "N/A" | |
self._axes[f"index{dim_number}"] = np.arange(dim_length) | |
self._axes_units[f"index{dim_number}"] = "N/A" |
units="1/nm", | ||
) | ||
qvector_lengths = [ | ||
self._configuration["q_vectors"][q]["q_vectors"].shape[1] for q in q_values |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given you refer to self._configuration["q_vectors"]
a lot, would recommend adding
qvec_info = self._configuration["q_vectors"]
Description of work
The Q vectors used in MDANSE calculations are typically created using a generator based on a limited number of input parameters. To improve the transparency and reproducibility of the calculations, it is meaningful to save the information about the exact values of the q vectors that were used in each calculation.
closes #564
Fixes
To test
Run a scattering analysis. Confirm that the q vectors have been written into the output files.
Use SphericalLatticeQVectors in a DCSF run on a trajectory with fixed simulation box dimensions. Check that the HKL values are all integer numbers.