Skip to main content

Python application test Coverage Documentation Status PyPI - Python Version PyPI DOI

pyrkm banner pyrkm banner

What is a Restricted Kirchhoff Machine?

You may be familiar with Restricted Boltzmann Machines (RBMs) [1]-[2], which are a type of generative neural network that can learn a probability distribution over its input data. The Restricted Kirchhoff Machine (RKM) is a realization of a RBM using resistor networks, and Kirchhoff's laws of electrical circuits. In this repository, we provide a Python package to virtually simulate the training and evaluation of RKMs.

For more information about the capabilities of the RKM, see the original paper by Link to arXiv paper.

Repository Contents

In this repository you will find the following:

  • src/pyrkm/: The main package code. You can use this code to train and evaluate RKMs. For more information, see the documentation. For a quick start, see the Usage section below.
  • energy_consumption: A series of scripts to evaluate the energy consumption of the RKM and compare it to the estimated cost of a RBM. They are used to generate the results in the paper.

Getting Started

To get started with the project, follow these steps:

  • Prerequisites: In order to correctly install pyrkm you need python3.9 or higher. If you don't have it installed, you can download it from the official website.

  • Install the package:

    python -m pip install pyrkm
    
  • Or: Clone the repository:

    git clone https://github.com/Kirchhoff-Machines/pyrkm.git
    cd pyrkm
    git submodule init
    git submodule update
    pip install .
    

Usage

To learn how to use the package, follow the official documentation and in particular this tutorial.

Contribution Guidelines

We welcome contributions to improve and expand the capabilities of this project. If you have ideas, bug fixes, or enhancements, please submit a pull request. Check out our Contributing Guidelines to get started with development.

Generative-AI Disclaimer

Parts of the code have been generated and/or refined using GitHub Copilot. All AI-output has been verified for correctness, accuracy and completeness, revised where needed, and approved by the author(s).

How to cite

Please consider citing this software that is published in Zenodo under the DOI 10.5281/zenodo.14865380.

License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.

Metadata

Release files for pyrkm 0.1.0

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

Source distribution (sdist)

Source distribution for pyrkm 0.1.0
File Size Uploaded Provenance
pyrkm-0.1.0.tar.gz 30.2 kB With provenance Details

Built distribution (wheel)

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

Total release size: 61.9 kB

Release files / pyrkm-0.1.0.tar.gz

Download URL pyrkm-0.1.0.tar.gz
Size 30.2 kB
Tags Source
SHA-256 checksum
How to use checksums
9f36aab8e74e181e2683af70ad36a723653d6b66650bf90a2b1cf075921142a2
BLAKE2b-256 checksum
How to use checksums
0efc4dc7ecb90094cd3a4a217f34e72e0ba50f5e41b7e3886fb55bf766575f2b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 23, 2025.

Transparency log

Release files / pyrkm-0.1.0-py3-none-any.whl

Download URL pyrkm-0.1.0-py3-none-any.whl
Size 31.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
506855c2c5451b20b12504ceafc5318d892ef0416fb84d5a62ccc0174cf9aca3
BLAKE2b-256 checksum
How to use checksums
6dcd1c9269397f0cbb272dfa9233bc260595fa10138bb052b6a99054423e10c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 23, 2025.

Transparency log

Security for pyrkm 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pyrkm-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 23, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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