Skip to main content

MultiPieGen

test

Generation code and data for the new multipole basis of MultiPie Ver.3 and later. MultiPie in this package and its documentation means MultiPie Ver.2 (whose general utilities are used here) unless another version is named.

The new basis is built on a common root cluster (Oh and D6h clusters). Each point group and space group is related to it through its parent group. This repository holds:

  • the data tables (multipiegen/data): groups, Wyckoff positions, parent groups, operation and harmonics mappings, ...
  • the code that generates the binary data and the PDFs from these tables

The input data are independent of MultiPie Ver.2: the binaries and PDFs are made from these tables alone. MultiPie Ver.2 is used only for its general functions and utilities (expression parsing, BinaryManager, LaTeX/PDF output, tags and types), and in the tests to compare with it.

The generated binaries and PDFs are delivered to other repositories: part of the binaries to MultiPie Ver.3 and later, and the rest of the binaries and the PDFs to a separate repository.

Requirements

  • Python 3.12 or later
  • MultiPie Ver.2.4 or later, NumPy 2, SymPy
  • for the PDFs only: a TeX distribution with ptex2pdf (e.g., TeX Live)

Install

pip install multipiegen

The package includes the binary data for MultiPie (multipiegen/binary_data), which can be loaded with multipiegen.util.util_binary_data.load_binary_data. The other binary data (multipiegen/binary) and the PDFs (multipiegen/pdf) are kept in the repository but are not included in the package.

For development (to generate and load all the binaries), clone the repository and use the editable install:

pip install -e ".[dev]"

Generated data

In the last column, the first line <generate> is the module that generates the output (python -m multipiegen.<generate>), and the second line <load> the function that loads it (multipiegen.util.<load>).

output content generate / load
binary/info.pkl overall information: group id/tag/name, character alias and compatibility relation, root cluster, orbital basis and basis functions, response tensor create_binary.create_info
util_info.load_info()
binary/cluster_scalar_basis.pkl orthonormal (scalar) cluster basis of the Oh (48) and D6h (24) clusters, keyed by PGMultipoleType as MultiPie Ver.2's site SAMB create_binary.create_cluster_scalar_basis
util_cluster_basis.load_cluster_basis()
binary/cluster_vector_basis.pkl orthonormal vector cluster basis (internal rank s=1, polar q / axial g internal basis) of the Oh (144) and D6h (72) clusters, keyed by PGMultipoleType as MultiPie Ver.2's vector SAMB; intermediate basis for cluster_bond_basis.pkl create_binary.create_cluster_vector_basis
util_cluster_vector_basis.load_cluster_vector_basis()
binary/cluster_bond_basis.pkl orthonormal bond cluster basis of the Oh (48) and D6h (24) clusters, from the vector cluster basis and the bond vectors (vector0), keyed by PGMultipoleType as MultiPie Ver.2's bond_a create_binary.create_cluster_bond_basis
util_bond_cluster_basis.load_bond_cluster_basis()
binary/response_tensor.pkl response tensors (rank 0-4, Q/G/T/M) of all MPG in terms of active multipoles create_binary.create_response_tensor
util_response_tensor.load_response_tensor()
binary/atomic_multipole.pkl matrices of atomic multipoles (rank l <= 7, s = 0, 1) in the LMs/JML/LM basis of s, p, d, f orbitals create_binary.create_atomic_multipole
util_atomic_multipole.load_atomic_multipole()
binary/atomic_multipole_group.pkl atomic multipole SAMB of all 47 point groups in the JML/Lgs/Lg basis create_binary.create_atomic_multipole_group
util_atomic_multipole.load_atomic_multipole_group()
binary/cluster_samb.pkl cluster SAMB of each Wyckoff site and bond (site; bond = symmetric Q and anti-symmetric T/M) of the real point groups and the space groups create_binary.create_cluster_samb
util_cluster_samb.load_cluster_samb()
binary/harmonics.pkl expression and u-matrix of the harmonics of all 47 point groups (rank l <= 11); the other multipole-keyed binaries look them up by the key create_binary.create_harmonics
util_harmonics.load_harmonics()
binary/multipolar_harmonics.pkl multipolar harmonics (s = 1, 2, 3, rank l <= 3) of all 47 point groups with polar (q) and axial (g) internal basis (data_basis orbitals) create_binary.create_multipolar_harmonics
util_harmonics_multipole.load_multipolar_harmonics()
binary/group.pkl data of all PG (47), SG, MPG and MSG: symmetry operations, product table, mapping to the Oh/D6h cluster, character, Wyckoff site and bond, active multipoles create_binary.create_group
util_group.load_group()
binary_data/info.pkl, binary_data/{PG,SG,MPG,MSG}/{id}.pkl (: of the id replaced by _, e.g. PG/PG_32.pkl) binary data for MultiPie Ver.3 and later, in the layout of MultiPie's multipie/binary_data: info and one file for each group, made from the binaries above (see the "Binary data" page) create_binary.create_binary_data
util_binary_data.load_binary_data("PG:32")
pdf/PG/{no}-{tag}/harmonics.{tex,pdf} harmonics of all 47 point groups, with polar and axial symbols side by side create_pdf.create_pdf_harmonics
pdf/{PG,SG,MPG,MSG}/*/{character_table,symmetry_operation,wyckoff_site,wyckoff_bond,representation_matrix,multipolar_harmonics_s{1,2,3}_{q,g},atomic_multipole_{lg,lgs,jml},response_tensor_X}.{tex,pdf} each group: character table, representation matrices, multipolar harmonics and atomic multipoles (PG), symmetry operations, Wyckoff site and bond (PG, SG), response tensors (MPG) create_pdf.create_pdf_group
pdf/info/*.{tex,pdf} overall information: lists of PG, SG, MPG and MSG, compatibility relation with orbitals, active multipoles create_pdf.create_pdf_info

The binaries use the format of MultiPie Ver.2's BinaryManager (gzip-compressed pickle with a header). str(load_info()) shows the description of the contents.

from multipiegen.util.util_info import load_info
from multipiegen.util.util_cluster_basis import load_cluster_basis

info = load_info()
info["harmonics"]["basis_function"]["fc"]  # (expression, <m|gamma>.T)
basis = load_cluster_basis()["Oh"]["basis"]  # {PGMultipoleType: values (dim, 48) on the cluster points}

See examples for runnable sample code for each feature.

Layout

multipiegen/        package
  data/             data tables (see the "Data tables" page)
  util/             utilities (multipolar harmonics, cluster basis, vector cluster basis, bond cluster basis, cluster SAMB, harmonics, harmonics symbols, multipolar harmonics, atomic multipole, info, group, symmetry operation, representation matrix, response tensor)
  create_binary/    code that generates the binary data
  create_pdf/       code that generates the PDFs
  binary/           generated binary data (info.pkl, cluster_scalar_basis.pkl, cluster_vector_basis.pkl, cluster_bond_basis.pkl, cluster_samb.pkl, harmonics.pkl, multipolar_harmonics.pkl, atomic_multipole.pkl, atomic_multipole_group.pkl, group.pkl, response_tensor.pkl) [not packaged]
  binary_data/      binary data for MultiPie (info.pkl, PG/, SG/, MPG/, MSG/: one file for each group, made from binary/) [packaged]
  pdf/              generated LaTeX and PDF (PG/032-Oh/harmonics.pdf, info/PG.pdf, ...) [not packaged]
docs/
  examples/         sample code for each feature
  src/guide.md      user guide: definitions of the provided quantities and their generation rules (guide_ja.md: Japanese)
  src/changes_from_multipie_v2.md  changes from MultiPie Ver.2, in the Details chapter (_ja.md: Japanese)
tests/              pytest tests
others/             non-package material
  creation/         scripts that generate the data tables in multipiegen/data

Workflow

  1. Data tables: the scripts in others/creation/ write their output next to themselves. Copy the result into multipiegen/data/ when it is final.
  2. Binary data: run the modules in multipiegen/create_binary/. Each writes to multipiegen/binary/. Then create_binary_data regroups them into multipiegen/binary_data/ for MultiPie.
  3. PDFs: run the modules in multipiegen/create_pdf/. Each writes to multipiegen/pdf/.
  4. Check: run pytest. The tests also check that the saved binaries agree with the current data tables.

When a feature is added, its generator goes in create_binary/ or create_pdf/, and a sample goes in docs/examples/.

Documentation

The documentation (this page, data, binary contents, harmonics PDFs, examples and API) is built with Jupyter Book from docs/:

make -C docs build   # -> docs/_build/html (needs the dev install)

The workflow docs builds it for pull requests and pushes, and publishes it to the gh-pages branch on main.

Test

pytest

The tests run on GitHub Actions (ubuntu/macos × Python 3.12/3.13) for pull requests and for pushes to main and develop.

Branches

  • Branch from develop, and open pull requests against develop.

  • When a pull request is merged into develop, the workflow delete merged branch deletes its branch on GitHub.

  • To delete the merged branch locally as well, enable the hook once per clone:

    git config core.hooksPath .githooks
    git config fetch.prune true
    

    After that, git pull on develop deletes the local branches that are merged and gone on the remote.

  • develop is merged into main manually on GitHub; develop is never deleted.

License

MPL-2.0

Metadata

Release files for multipiegen 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for multipiegen 0.1.0
File Size Uploaded Provenance Actions
multipiegen-0.1.0.tar.gz 17.5 MB With provenance Details for multipiegen-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for multipiegen 0.1.0
File Interpreter ABI Platform Actions
multipiegen-0.1.0-py3-none-any.whl Python 3 none any Details for multipiegen-0.1.0-py3-none-any.whl

Total release size: 35.4 MB

Release files / multipiegen-0.1.0.tar.gz

Download URL multipiegen-0.1.0.tar.gz
Size 17.5 MB
Tags Source
SHA-256 checksum
How to use checksums
8162c330aa3135621b1d194034ef4512e4a3266b90b7394993bedbef7c0929a9
BLAKE2b-256 checksum
How to use checksums
ae24e9e3f0f9850d9cba122f282cabe0b1e0f8bd09aea5b0eb0de77ba63232a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

Release files / multipiegen-0.1.0-py3-none-any.whl

Download URL multipiegen-0.1.0-py3-none-any.whl
Size 18.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
53d0feaf3c6c46a09e31d0e8ae1eb0cbc54af62d427b26ce462b9cd197189bb2
BLAKE2b-256 checksum
How to use checksums
38af933b17cb9fdbc6a073f04e2d4d3a4e030af7d757677e1878f4b5875f312f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

Security for multipiegen 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for multipiegen-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page