PyQrackIsing 1.3.2__tar.gz → 1.3.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyqrackising-1.3.2/PyQrackIsing.egg-info → pyqrackising-1.3.4}/PKG-INFO +1 -1
- {pyqrackising-1.3.2 → pyqrackising-1.3.4}/PyQrackIsing/_pyqrack_ising.cpp +2 -1
- {pyqrackising-1.3.2 → pyqrackising-1.3.4/PyQrackIsing.egg-info}/PKG-INFO +1 -1
- {pyqrackising-1.3.2 → pyqrackising-1.3.4}/pyproject.toml +1 -1
- {pyqrackising-1.3.2 → pyqrackising-1.3.4}/setup.py +1 -1
- {pyqrackising-1.3.2 → pyqrackising-1.3.4}/CMakeLists.txt +0 -0
- {pyqrackising-1.3.2 → pyqrackising-1.3.4}/LICENSE.md +0 -0
- {pyqrackising-1.3.2 → pyqrackising-1.3.4}/MANIFEST.in +0 -0
- {pyqrackising-1.3.2 → pyqrackising-1.3.4}/PyQrackIsing/__init__.py +0 -0
- {pyqrackising-1.3.2 → pyqrackising-1.3.4}/PyQrackIsing/generate_tfim_samples.py +0 -0
- {pyqrackising-1.3.2 → pyqrackising-1.3.4}/PyQrackIsing/tfim_magnetization.py +0 -0
- {pyqrackising-1.3.2 → pyqrackising-1.3.4}/PyQrackIsing/tfim_square_magnetization.py +0 -0
- {pyqrackising-1.3.2 → pyqrackising-1.3.4}/PyQrackIsing.egg-info/SOURCES.txt +0 -0
- {pyqrackising-1.3.2 → pyqrackising-1.3.4}/PyQrackIsing.egg-info/dependency_links.txt +0 -0
- {pyqrackising-1.3.2 → pyqrackising-1.3.4}/PyQrackIsing.egg-info/not-zip-safe +0 -0
- {pyqrackising-1.3.2 → pyqrackising-1.3.4}/PyQrackIsing.egg-info/top_level.txt +0 -0
- {pyqrackising-1.3.2 → pyqrackising-1.3.4}/README.md +0 -0
- {pyqrackising-1.3.2 → pyqrackising-1.3.4}/setup.cfg +0 -0
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
#include <pybind11/pybind11.h>
|
|
3
3
|
#include <pybind11/stl.h>
|
|
4
4
|
#include <cmath>
|
|
5
|
+
#include <limits>
|
|
5
6
|
#include <random>
|
|
6
7
|
#include <string>
|
|
7
8
|
#include <vector>
|
|
@@ -66,7 +67,7 @@ static inline double expected_closeness_weight(size_t n_rows, size_t n_cols, siz
|
|
|
66
67
|
static inline std::vector<double> probability_by_hamming_weight(double J, double h, double z, double theta, double t, size_t n_qubits)
|
|
67
68
|
{
|
|
68
69
|
// critical angle
|
|
69
|
-
const double theta_c = std::asin(h / (z * J));
|
|
70
|
+
const double theta_c = std::asin(std::max(-1.0, std::min(1.0, (std::abs(z * J) >= (std::numeric_limits<double>::epsilon() / 2)) ? std::abs(h) / (z * J) : (J > 0 ? 1.0 : -1.0))));
|
|
70
71
|
const double delta_theta = theta - theta_c;
|
|
71
72
|
std::vector<double> bias;
|
|
72
73
|
if (std::abs(h) < 1e-12) {
|
|
@@ -8,7 +8,7 @@ build-backend = "setuptools.build_meta"
|
|
|
8
8
|
|
|
9
9
|
[project]
|
|
10
10
|
name = "PyQrackIsing"
|
|
11
|
-
version = "1.3.
|
|
11
|
+
version = "1.3.4"
|
|
12
12
|
requires-python = ">=3.8"
|
|
13
13
|
description = "Near-ideal closed-form solutions for transverse field Ising model (TFIM)"
|
|
14
14
|
readme = {file = "README.txt", content-type = "text/markdown"}
|
|
@@ -40,7 +40,7 @@ ext_modules = [CMakeExtension('tfim_sampler')]
|
|
|
40
40
|
|
|
41
41
|
setup(
|
|
42
42
|
name='PyQrackIsing',
|
|
43
|
-
version='1.3.
|
|
43
|
+
version='1.3.4',
|
|
44
44
|
author='Dan Strano',
|
|
45
45
|
author_email='stranoj@gmail.com',
|
|
46
46
|
description='Near-ideal closed-form solutions for transverse field Ising model (TFIM)',
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|