Skip to main content

BIGUE hyperbolic embedder

isolated

Bayesian Inference of a Graph's Unkown Embedding (BIGUE) is a Markov Chain Monte Carlo algorithm that samples the best hyperbolic embeddings of a given network according to a Bayesian $\mathbb{S}^1$ model.

The code used to generate the Figures in the paper is in the bigue-analysis repository. If you use this algorithm, please cite:

Ariane Lizotte, Jean-Gabriel Young and Antoine Allard "Symmetry-driven embedding of networks in hyperbolic space". Commun. Phys. 8, 199 (2025). https://doi.org/10.1038/s42005-025-02122-0

Ariane Lizotte. "bigue". Zenodo (2025). https://doi.org/10.5281/zenodo.15189657.

Installation

Dependencies

The pybigue library requires:

  • Python (>= 3.10)
  • NumPy
  • SciPy
  • CmdStanPy
  • Numba

pybigue can be installed directly from PyPi

pip install pybigue

Usage

To use the default BIGUE sampler,

from pybigue.sampling import sample_bigue, read_sample

# ... code that obtains an numpy adjacency matrix

sample_directory = "./sample/"
sample_bigue(adjacency_matrix, sample_directory) # Writes samples to disk
samples = read_sample(sample_directory) # Reads samples

Two complete examples are presented in the examples. The file embed_synthetic_graph.py uses the default BIGUE algorithm (requires also matplotlib) and the file manual_sampling.py shows how one can tweak the sampler (hyperparameter values, prior distributions, subkernel selection probabilities, combining with Stan HMC, etc.).

Note that the samples are not aligned automatically. This Python library doesn't provide a tool to compute automorphisms. This can be found in the bigue-analysis repository. Nevertheless, the samples can be aligned given a list of automorphisms

from pybigue.models import S1Model

# Each automorphism is an array of the new label of each vertex.
automorphisms = [np.arange(adjacency_matrix.shape[0])] # Trivial automorphism
aligned_samples = {
    chain: S1Model.align_sample(sample, reference_thetas=some_thetas, automorphisms=automorphisms)
        for chain, sample in samples.items()
}

Source code

The lastest version can be fetched with

git clone https://github.com/DynamicaLab/bigue.git

Testing

After downloding the code, the test suite can be ran using (requires installing pytest)

pytest pybigue

Metadata

Release files for pybigue 1.0.1

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

Source distribution (sdist)

Source distribution for pybigue 1.0.1
File Size Uploaded Provenance
pybigue-1.0.1.tar.gz 37.4 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 75.9 kB

Release files / pybigue-1.0.1.tar.gz

Download URL pybigue-1.0.1.tar.gz
Size 37.4 kB
Tags Source
SHA-256 checksum
How to use checksums
1595db011ba91234d0f87c61248da49f0ce91c4cf6c149b01767b74484f233b0
BLAKE2b-256 checksum
How to use checksums
41fdc4e345160ebcab3baaa2e2e9592cefc63abeaf3875041ce6b8b57ae6cf2b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.13

Release files / pybigue-1.0.1-py3-none-any.whl

Download URL pybigue-1.0.1-py3-none-any.whl
Size 38.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
79b66c0ff4425722471f72b0c7126a8bd04da412c448a6a6cec7a71dc9f3d707
BLAKE2b-256 checksum
How to use checksums
ef6400ba7903b3a3a8397af848096e9fd9ce54e0fc59213add2b509ae433810e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.13

Security for pybigue 1.0.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

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