Skip to main content

Python library for symmetry, group theory, and quantum physics applications

Project description

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! 🎉

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pysymmetry-1.0.0.tar.gz (199.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pysymmetry-1.0.0-py3-none-any.whl (238.6 kB view details)

Uploaded Python 3

File details

Details for the file pysymmetry-1.0.0.tar.gz.

File metadata

  • Download URL: pysymmetry-1.0.0.tar.gz
  • Upload date:
  • Size: 199.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for pysymmetry-1.0.0.tar.gz
Algorithm Hash digest
SHA256 879295ae844957798c1cbd27c8d829e7d4af0881fb72b628b8bdb497303f37ba
MD5 667e581ce81c70105d034bcd0d73c122
BLAKE2b-256 0254bdfabcd56d910b3f6d5a8437aae7e161bae1255b5c924e8f37493bc3681a

See more details on using hashes here.

File details

Details for the file pysymmetry-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pysymmetry-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 238.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for pysymmetry-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4468163a949e0a2baa5b437ca3463ab3f22b7e14e4906f9b3d77fd0c58dff99b
MD5 4a1914470bd35ddf70854efb662a4ac3
BLAKE2b-256 c2c7d11e5b70a485a392486f97442ed73675072b21a8c5ab48ca3d1b897e4c63

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page