Skip to main content

PySymmetry - Python Symmetry

PySymmetry (Python Symmetry) is a comprehensive Python library for describing symmetries and their applications in physics.

Features

Quantum Physics Module (phys.quantum)

Complete quantum simulation framework with:

  • State Representations: Ket, Bra, DensityMatrix, entangled states (Bell, GHZ, W)
  • Hamiltonian Operators: Free particle, harmonic oscillator, hydrogen atom, spin systems
  • Schrodinger Solvers: Exact diagonalization, sparse solvers, time evolution
  • Symmetry Analysis: Parity, translation, selection rules, conserved quantities
  • Interactive API: SceneBuilder for arbitrary quantum scenarios

Core Modules

  • Group Theory: Abstract groups, finite groups, continuous groups (U(1), SU(2), SO(3), etc.)
  • Lie Theory: Lie algebras, representations, root systems
  • Linear Algebra: Matrix operations, eigendecomposition

Abstract Physics (abstract_phys)

Framework for physical symmetries:

  • Symmetry operations (translation, rotation, parity, time reversal)
  • Physical representations
  • Conservation laws via Noether's theorem

Installation

pip install PySymmetry

Quick Start

Quantum Simulation

from PySymmetry.phys.quantum import SceneBuilder, simulate, QuantumAnalyzer

# Create a harmonic oscillator
scene = (SceneBuilder("Harmonic Oscillator")
         .add_electron(position=[0])
         .add_harmonic_potential(center=[0], k=1.0)
         .set_spatial_range(-10, 10)
         .set_grid_points(300)
         .build())

# Simulate
result = simulate(scene, num_states=5)

# Analyze
analyzer = QuantumAnalyzer(result.hamiltonian, result)
print(analyzer.generate_report())

Symmetry Analysis

from PySymmetry.phys.quantum import analyze, quick_report

# Full analysis
result = analyze(hamiltonian, simulation_result)

# Quick report
print(quick_report(hamiltonian, simulation_result))

Examples

See examples/ directory:

  • quantum_examples.py - Basic quantum systems (hydrogen, square well, spin)
  • interactive_demo.py - Arbitrary scenario simulation
  • analysis_demo.py - Symmetry analysis demonstrations

Project Structure

PySymmetry/
├── src/
│   └── PySymmetry/
│       ├── core/                    # Core mathematics
│       │   ├── algebraic_structures/
│       │   ├── group_theory/
│       │   ├── lie_theory/
│       │   ├── matrix/
|       |   └── and more... 
│       │
│       ├── abstract_phys/           # Physical abstractions
│       │   ├── physical_objects/
│       │   ├── representation/
│       │   ├── symmetry_operations/
│       │   ├── symmetry_environments/
|       |   └── and more... 
│       │
│       └── phys/                   # Physics applications
│           └── quantum/             # Quantum module
│
├── examples/
├── tests/
├── pyproject.toml
└── README.md

Development Status

Version: 1.0.0

Completed

  • Core mathematical layer (groups, Lie algebras, representations)
  • Abstract physics framework (symmetries, operations)
  • Quantum physics module (states, Hamiltonians, solvers, analysis)

In Progress

  • Visualization tools
  • Additional physics examples
  • Performance optimization

Requirements

  • Python >= 3.10
  • numpy >= 1.24
  • scipy >= 1.10

Optional

  • matplotlib (visualization)
  • sympy (symbolic computation)
  • spglib (crystallography)

Contributing

Contributions welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Run tests with pytest
  4. Submit a pull request

License

MIT License - see LICENSE

Author

LDK (Cathylinlin)


Explore the beautiful world of symmetries! 🎉

Metadata

Release files for PySymmetry 1.0.1

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

Source distribution (sdist)

Source distribution for PySymmetry 1.0.1
File Size Uploaded
pysymmetry-1.0.1.tar.gz 284.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for PySymmetry 1.0.1
File Interpreter ABI Platform
pysymmetry-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 581.9 kB

Release files / pysymmetry-1.0.1.tar.gz

Download URL pysymmetry-1.0.1.tar.gz
Size 284.3 kB
Tags Source
SHA-256 checksum
How to use checksums
adbd5bea2849c8df8f7c08e2d43a4ae5298be098a0745c09d08e2ca07a31208e
BLAKE2b-256 checksum
How to use checksums
cd48f3b9641ce8569b6319aea1c14f9f37083a0a495339e716f427414a7eb232
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.7

Release files / pysymmetry-1.0.1-py3-none-any.whl

Download URL pysymmetry-1.0.1-py3-none-any.whl
Size 297.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
46c4e5d965fa88f44bdef428e17381bea8820a27efe7ae6293f07ea901b123e2
BLAKE2b-256 checksum
How to use checksums
f5e4f28554541705cfedc9c9f8770a820577f4c670a5ab1b2555b28bf3936fd2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.7

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

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