Skip to main content

Near-ideal closed-form solutions for transverse field Ising model (TFIM)

Project description

PyQrack Ising

Efficiently generate near-ideal samples from transverse field Ising model (TFIM)

(It's "the Ising on top.")

PyPI Downloads

Copyright and license

(c) Daniel Strano and the Qrack contributors 2025. All rights reserved.

Installation

From PyPi:

pip3 install PyQrackIsing

From Source: install pybind11, then

pip3 install .

in the root source directory (with setup.py).

Windows users might find Windows Subsystem Linux (WSL) to be the easier and preferred choice for installation.

Usage

from PyQrackIsing import generate_tfim_samples

samples = generate_tfim_samples(
    J=-1.0,
    h=2.0,
    z=4,
    theta=0.174532925199432957,
    t=5,
    n_qubits=56,
    shots=100
)

There are two other functions, tfim_magnetization() and tfim_square_magnetization(), that follow the same function signature except without the shots argument.

The library also provides a TFIM-inspired (approximate) MAXCUT solver:

from PyQrackIsing import maxcut_tfim
import networkx as nx

G = nx.petersen_graph()
best_cut_value, best_solution_bit_string, best_cut_edges = maxcut_tfim(G, quality=10)

The (integer) quality setting is optional, with a default value of 10, but you can turn it up for higher-quality results, or turn it down to save time. (You can also optionally specify the number of measurement shots as an argument, if you want specific fine-grained control over resource usage.) If you want to run MAXCUT on a graph with non-uniform edge weights, specify them as the weight attribute of each edge, with networkx. (If any weight attribute is not defined, the solver assumes it's 1.0 for that edge.)

About

Transverse field Ising model (TFIM) is the basis of most claimed algorithmic "quantum advantage," circa 2025, with the notable exception of Shor's integer factoring algorithm.

Sometimes a solution (or at least near-solution) to a monster of a differential equation hits us out of the blue. Then, it's easy to validate the guess, if it's right. (We don't question it and just move on with our lives, from there.)

Special thanks to OpenAI GPT "Elara," for help on the model and converting the original Python scripts to PyBind11!

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyqrackising-1.4.1.tar.gz (11.1 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyqrackising-1.4.1-cp313-cp313-macosx_15_0_arm64.whl (87.7 kB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

pyqrackising-1.4.1-cp313-cp313-macosx_14_0_arm64.whl (88.9 kB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

pyqrackising-1.4.1-cp312-cp312-win_amd64.whl (102.7 kB view details)

Uploaded CPython 3.12Windows x86-64

pyqrackising-1.4.1-cp312-cp312-manylinux_2_39_x86_64.whl (99.9 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ x86-64

PyQrackIsing-1.4.1-cp310-cp310-manylinux_2_35_x86_64.whl (92.5 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.35+ x86-64

File details

Details for the file pyqrackising-1.4.1.tar.gz.

File metadata

  • Download URL: pyqrackising-1.4.1.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for pyqrackising-1.4.1.tar.gz
Algorithm Hash digest
SHA256 b9c58d3de3b7a1f33a06712892fc28495bfab7b535e377060fef3443dc0bc046
MD5 5d24bc40a97fadca05f78b8eec4f3f98
BLAKE2b-256 d740c66614b254af4d58345b3f34de5f0d5ed30d643ccff9a493c483dc57e1bf

See more details on using hashes here.

File details

Details for the file pyqrackising-1.4.1-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for pyqrackising-1.4.1-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 2f133c725d3ff51b8e7cf3f99368597c3854c732b2ad02b966669d01bd3fc53c
MD5 fdf73e453453405da0c58b2f82985c85
BLAKE2b-256 cf225dc66abebd9453c9a7a7003ed2494cbaa6276d6c5254c5e0075543dfd962

See more details on using hashes here.

File details

Details for the file pyqrackising-1.4.1-cp313-cp313-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pyqrackising-1.4.1-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 370ae1ea198d7e776fab78cd9434dbc0fd5ce11680f38aa0fe5263a8726efcb9
MD5 92142d82164edb903c7ee7619c9b1af9
BLAKE2b-256 90be4bd4abe1f3cda34cdba5fbab1286f3767ccf167ec3d524f8297e962777b4

See more details on using hashes here.

File details

Details for the file pyqrackising-1.4.1-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for pyqrackising-1.4.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 7b82d145008386a3669fc233305950ccf0fcf75264a0fae3dbd89bb2c05e29da
MD5 e8b85a25f4b471173cbd8be3cdce82f1
BLAKE2b-256 572b16d626b9e273a5e6414e4011c93ef5334b98a1f7a8a91ec307a68a64260d

See more details on using hashes here.

File details

Details for the file pyqrackising-1.4.1-cp312-cp312-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for pyqrackising-1.4.1-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 c097da2d515a2ed0623b84d229ac4224b5a1d43fe23e8e74076506d2f705a0a3
MD5 701d1cd0afb3f42cdb9effb657878683
BLAKE2b-256 dac6162b0c77f15743477b887b28682c3a8e00969ca04224c01c4334df94052d

See more details on using hashes here.

File details

Details for the file PyQrackIsing-1.4.1-cp310-cp310-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for PyQrackIsing-1.4.1-cp310-cp310-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 370e7ec03c9630034d46525af56b9081b2c6102f301f87c21afe92b81ec39dd9
MD5 d6519cd35d91dcbd2fe88933db201058
BLAKE2b-256 e01413b770916f3690cd0d7883bb8b0156c51e3a32a737f8c2d90bf8e135b5db

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