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.1.tar.gz (284.3 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.1-py3-none-any.whl (297.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pysymmetry-1.0.1.tar.gz
  • Upload date:
  • Size: 284.3 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.1.tar.gz
Algorithm Hash digest
SHA256 adbd5bea2849c8df8f7c08e2d43a4ae5298be098a0745c09d08e2ca07a31208e
MD5 8b5e16c17f3c04689d43c6e64fab5824
BLAKE2b-256 cd48f3b9641ce8569b6319aea1c14f9f37083a0a495339e716f427414a7eb232

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pysymmetry-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 297.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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 46c4e5d965fa88f44bdef428e17381bea8820a27efe7ae6293f07ea901b123e2
MD5 9827fafe0033652ce7af516f62454918
BLAKE2b-256 f5e4f28554541705cfedc9c9f8770a820577f4c670a5ab1b2555b28bf3936fd2

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