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

Investigate processing time for symmetry analysis and view_crystal #343

Open
kbarros opened this issue Dec 11, 2024 · 1 comment
Open

Investigate processing time for symmetry analysis and view_crystal #343

kbarros opened this issue Dec 11, 2024 · 1 comment

Comments

@kbarros
Copy link
Member

kbarros commented Dec 11, 2024

cryst = Sunny.pyrochlore_crystal()
@time view_crystal(cryst)

On my machine this takes 0.7 s. Then @profview shows about 25% of the time is in basis_for_symmetry_allowed_couplings. The cost of this function scales as follows:

@time reference_bonds(cryst, 1.0) # 0.063 s
@time reference_bonds(cryst, 2.0) # 0.42 s (note: 0.063 * 2^3 = 0.504)
@time reference_bonds(cryst, 4.0) # 3.32 s (note: 0.42 * 2^3 = 3.36s)

A cubic scaling wouldn't be surprising here. But maybe there are strategies to make this faster.

@kbarros kbarros changed the title Investigate view_crystal processing time Investigate processing time for symmetry analysis and view_crystal Dec 11, 2024
@kbarros
Copy link
Member Author

kbarros commented Dec 12, 2024

The time for reference_bonds(cryst, 4.0) drops to just 0.05 s (a factor of 60+ speedup) if the score_bond function is disabled. So the slow thing is selecting, from among all equivalent bonds, which one should be used as the reference bond.

Within scoring, the slow thing is likely to be basis_for_symmetry_allowed_couplings -> basis_for_symmetry_allowed_couplings_aux.

Currently, this "basis" is being calculated from scratch. Instead, after calculating it for one bond, it can be rotated to each of the symmetry-equivalent bonds in the list. It would still necessary to re-sparsify after each rotation, but this step is probably faster than calculating everything from scratch.

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

No branches or pull requests

1 participant