Skip to content

AstroGuy1/Superposition

Repository files navigation

Superposition: A Quantum Mechanics Modeling Software

Introduction

Superposition is an advanced Python-based tool designed to simulate and visualize quantum systems. This software allows users to solve the Schrödinger equation in one, two, or three dimensions with customizable potentials, adaptive mesh grids, parallel computing capabilities, and advanced visualization features. It is intended for researchers, educators, and students who wish to explore quantum mechanics numerically.

Features

  • Dimensional Flexibility: Solve quantum systems in 1D, 2D, or 3D.
  • Custom Potentials: Define your own potential functions using mathematical expressions.
  • Adaptive Mesh Grids: Utilize adaptive grids for improved accuracy in regions of interest.
  • Parallel Computing: Accelerate computations using multiprocessing or MPI.
  • Graphical User Interface (GUI): Intuitive GUI built with PyQt5 for easy interaction.
  • Advanced Visualization: 2D and 3D plotting, animations of time-dependent simulations.
  • Integration with Quantum Libraries: Leverages the QuTiP library for efficient quantum computations.
  • Modular Design: Organized codebase for maintainability and extensibility.

Project Structure

The project is organized into several modules, each responsible for different functionalities:

  • main.py: Entry point of the application.
  • quantum_solver.py: Handles numerical solutions of the Schrödinger equation.
  • potential.py: Manages user-defined potentials.
  • mesh.py: Implements spatial grids, including adaptive meshes.
  • parallel_compute.py: Facilitates parallel computations.
  • visualization.py: Provides tools for plotting and animating results.
  • gui.py: Contains the graphical user interface components.
  • config.py: Stores global configurations and constants.
  • utils.py: Utility functions for validation and other supportive tasks.

Installation Instructions

Prerequisites

  • Python 3.7 or higher

Required Python Libraries:

  • NumPy
  • SciPy
  • Matplotlib
  • QuTiP
  • PyQt5

Optional Libraries (for advanced features):

  • mpi4py (for parallel computing with MPI)
  • mayavi or Plotly (for enhanced 3D visualization)

Installation Steps

  1. Clone the Repository

    git clone https://github.com/yourusername/quantum-mechanics-modeling-software.git
    cd quantum-mechanics-modeling-software
  2. Create a Virtual Environment (Recommended)

    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
  3. Install Dependencies

    pip install -r requirements.txt

    If requirements.txt is not provided, install dependencies manually:

    pip install numpy scipy matplotlib qutip pyqt5
  4. Run the Application

    python main.py

Usage Instructions

Graphical User Interface (GUI)

  • Run main.py to launch the GUI.
  • Define the Potential: Enter a mathematical expression for the potential (e.g., 0.5 * MASS * OMEGA**2 * (x**2 + y**2 + z**2) for a 3D harmonic oscillator).
  • Set Mesh Parameters: Define spatial ranges and grid points.
  • Configure Simulation Parameters: Set the number of energy states to compute and enable/disable parallel computing.
  • Run the Simulation: Click the "Solve" button to start the computation. Results will be visualized upon completion.

Command-Line Interface (CLI)

  • Coming Soon: CLI support for running simulations and batch processing.

Module Explanations

  1. Main Application (main.py)
    Initializes the GUI and starts the application loop.

  2. Quantum Solver Module (quantum_solver.py)
    Constructs the Hamiltonian and solves the Schrödinger equation. Supports time evolution for time-dependent potentials.

  3. Potential Module (potential.py)
    Allows users to input custom potential functions. Can be extended to predefined potentials for common systems.

  4. Mesh Module (mesh.py)
    Generates 1D, 2D, or 3D spatial grids. Includes adaptive mesh grids for efficient computations.

  5. Parallel Computing Module (parallel_compute.py)
    Facilitates parallel computing using multiprocessing or MPI for large-scale simulations.

  6. Visualization Module (visualization.py)
    Provides 2D/3D plotting and animation tools for visualizing results.

  7. GUI Module (gui.py)
    Built with PyQt5 for an intuitive user experience. Manages user input and simulation settings.

  8. Utilities and Configurations

    • config.py: Stores physical constants and simulation parameters.
    • utils.py: Provides utility functions for validation and mesh generation.

About

A quantum mechanics simulator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages