CederGroupHub / smol

Statistical Mechanics on Lattices
https://cedergrouphub.github.io/smol/
Other
65 stars 14 forks source link

Enable printing ClusterExpansion as a latex table #364

Open qchempku2017 opened 1 year ago

qchempku2017 commented 1 year ago

Is your feature request related to a problem? Please describe. When writing details of cluster expansion in supplementary materials, one needs to manually convert cluster expansion representation string into a latex table object, which is not very convenient.

Describe the solution you'd like 1, Add an export_latex_table method to directly output correlation function information into a latex table. 2, This method should also require more information than currently provided in the pretty string, including down to the 3rd longest distance in a cluster, the corresponding species in bit_combo, and potentially the sub-lattices that each site in the cluster belongs to. 3, Allow adjusting the decimal precision of output. Having only 3 decimal is far from enough.

Describe alternatives you've considered Please describe alternative solutions or features you have considered.

lbluque commented 1 year ago

Thanks @qchempku2017. I think this should be handled as two different things:

  1. exporting latex tables (with any decimal precision you want). I suggest this not be hard-coded into the source since it is not a critical functionality, but simply convenience for some people, and IMO will just add bloat to the code making maintenance and testing harder. As an alternative, I suggest writing an independent function that does that for you, and if you want to share it (bc some people will likely benefit from that), then add it in an example notebook.
  2. If the current decimal precision used in the "pretty string" is not enough, then we simply need to update it to one that is.