Metadata-Version: 2.4
Name: pbitlang
Version: 1.0.1
Summary: Domain-specific language for thermodynamic computing Hamiltonians
Project-URL: Homepage, https://github.com/dmjdxb/Thermodynamic-Computing-Platform-/tree/main/pbitlang
Project-URL: Documentation, https://pbitlang.readthedocs.io
Project-URL: Repository, https://github.com/dmjdxb/Thermodynamic-Computing-Platform-/tree/main/pbitlang
Author: David Johnson
License: PbitLang Software License
        =========================
        
        Copyright (c) 2024 David Johnson. All Rights Reserved.
        
        NOTICE: This is proprietary software. By installing, copying, or using this
        software, you agree to be bound by the terms of this license.
        
        ================================================================================
                                      GRANT OF LICENSE
        ================================================================================
        
        Subject to the terms and conditions of this License, David Johnson ("Licensor")
        hereby grants you a limited, non-exclusive, non-transferable, royalty-free
        license to:
        
        1. INSTALL AND USE: You may install and use this software for personal,
           educational, research, or commercial purposes.
        
        2. BACKUP COPIES: You may make copies of the software solely for backup
           or archival purposes.
        
        3. INTEGRATION: You may use this software as a component in your own
           applications and products.
        
        ================================================================================
                                       RESTRICTIONS
        ================================================================================
        
        You may NOT, without prior written consent from the Licensor:
        
        1. MODIFY: Alter, adapt, translate, or create derivative works based on
           this software or any portion thereof.
        
        2. REDISTRIBUTE: Distribute, sublicense, lease, rent, loan, or otherwise
           transfer this software to any third party, whether for commercial
           purposes or otherwise.
        
        3. REVERSE ENGINEER: Reverse engineer, disassemble, decompile, or
           otherwise attempt to derive the source code of this software (except
           to the extent that such activity is expressly permitted by applicable
           law notwithstanding this limitation).
        
        4. REMOVE NOTICES: Remove, alter, or obscure any proprietary notices,
           labels, or marks on this software.
        
        5. COMPETE: Use this software to create a competing product or service.
        
        6. CLAIM OWNERSHIP: Represent that you own, created, or have rights to
           this software beyond those expressly granted herein.
        
        ================================================================================
                                   INTELLECTUAL PROPERTY
        ================================================================================
        
        This software, including all associated documentation, source code, object
        code, algorithms, and designs, is the exclusive intellectual property of
        David Johnson. This license does not grant you any ownership rights or
        intellectual property rights in the software.
        
        All rights not expressly granted herein are reserved by the Licensor.
        
        ================================================================================
                                      NO WARRANTY
        ================================================================================
        
        THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL
        THE LICENSOR BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER
        IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN
        CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
        
        ================================================================================
                                      TERMINATION
        ================================================================================
        
        This license is effective until terminated. Your rights under this license
        will terminate automatically without notice if you fail to comply with any
        of its terms. Upon termination, you must destroy all copies of the software
        in your possession.
        
        ================================================================================
                                    GOVERNING LAW
        ================================================================================
        
        This license shall be governed by and construed in accordance with applicable
        law, without regard to conflict of law principles.
        
        ================================================================================
                                       CONTACT
        ================================================================================
        
        For licensing inquiries, permissions, or commercial licensing arrangements:
        
        David Johnson
        GitHub: https://github.com/dmjdxb
        
        ================================================================================
        
        BY INSTALLING OR USING THIS SOFTWARE, YOU ACKNOWLEDGE THAT YOU HAVE READ,
        UNDERSTOOD, AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE.
        
        
        
License-File: LICENSE
Keywords: domain-specific-language,hamiltonian,ising-model,pbit,physics,spin-systems,statistical-mechanics,thermodynamic-computing
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: Other/Proprietary License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Physics
Classifier: Topic :: Software Development :: Compilers
Classifier: Topic :: Software Development :: Interpreters
Classifier: Typing :: Typed
Requires-Python: >=3.9
Provides-Extra: dev
Requires-Dist: mypy>=1.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Provides-Extra: docs
Requires-Dist: sphinx-rtd-theme>=1.0; extra == 'docs'
Requires-Dist: sphinx>=6.0; extra == 'docs'
Provides-Extra: phal
Requires-Dist: phal>=0.1.0; extra == 'phal'
Description-Content-Type: text/markdown

# PbitLang

**Domain-Specific Language for Thermodynamic Computing**

[![Python](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)
[![License](https://img.shields.io/badge/license-Proprietary-red.svg)](LICENSE)

PbitLang is a domain-specific language for expressing Hamiltonians (energy functions) with compile-time physics validation. It's designed for thermodynamic computing systems including P-bits, Ising machines, and quantum annealers.

## Features

- **Type System**: Dedicated types for spins (Ising, Potts, clock, continuous)
- **Lattice Geometries**: Built-in support for chains, square, triangular, honeycomb, etc.
- **Physics Validation**: Compile-time warnings about frustration, critical temperatures, symmetry violations
- **Standard Library**: Common models (Ising, Heisenberg, Potts) pre-implemented
- **Zero Dependencies**: Core has no required dependencies

## Installation

```bash
pip install pbitlang
```

## Quick Start

```python
import pbitlang

# Define a Hamiltonian
source = '''
hamiltonian IsingChain(n: int, J: real) -> ising on chain(n) {
    coupling: sum((i,j) in neighbors) { -J * s[i] * s[j] }
}
'''

# Compile and instantiate
model = pbitlang.compile(source)
hamiltonian = model.instantiate(n=10, J=1.0)
```

## Example: 2D Ising Model

```pbitlang
hamiltonian IsingSquare2D {
    lattice: square(10, 10, periodic)
    spins: ising
    
    // Ferromagnetic coupling
    energy: -sum over neighbors(i, j) {
        J * s[i] * s[j]
    }
    
    // External field
    energy: -h * sum over i { s[i] }
    
    param J: real = 1.0
    param h: real = 0.1
}
```

## CLI Usage

```bash
# Compile a Hamiltonian file
pbitlang compile my_model.pbit

# Interactive REPL
pbitlang repl
```

## Documentation

- [Language Specification](https://github.com/dmjdxb/Thermodynamic-Computing-Platform-/blob/main/pbitlang/docs/SPECIFICATION.txt)
- [User Manual](https://github.com/dmjdxb/Thermodynamic-Computing-Platform-/blob/main/pbitlang/docs/USER_MANUAL.txt)

## Part of the Thermodynamic Computing Platform

PbitLang is part of the [Thermodynamic Computing Platform](https://github.com/dmjdxb/Thermodynamic-Computing-Platform-), a comprehensive software stack for P-bit and thermodynamic hardware.

## License

**Proprietary Software** - Copyright © 2024 David Johnson. All Rights Reserved.

You may install and use this software, but modification and redistribution are prohibited without written consent. See [LICENSE](LICENSE) for full terms.

## Contact

- **GitHub**: [dmjdxb](https://github.com/dmjdxb)
- **Repository**: [Thermodynamic Computing Platform](https://github.com/dmjdxb/Thermodynamic-Computing-Platform-)



