PyQrackIsing 1.3.2__tar.gz → 1.3.3__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyQrackIsing
3
- Version: 1.3.2
3
+ Version: 1.3.3
4
4
  Summary: Near-ideal closed-form solutions for transverse field Ising model (TFIM)
5
5
  Home-page: https://github.com/vm6502q/PyQrackIsing
6
6
  Author: Dan Strano
@@ -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)) ? h / (z * J) : 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) {
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyQrackIsing
3
- Version: 1.3.2
3
+ Version: 1.3.3
4
4
  Summary: Near-ideal closed-form solutions for transverse field Ising model (TFIM)
5
5
  Home-page: https://github.com/vm6502q/PyQrackIsing
6
6
  Author: Dan Strano
@@ -8,7 +8,7 @@ build-backend = "setuptools.build_meta"
8
8
 
9
9
  [project]
10
10
  name = "PyQrackIsing"
11
- version = "1.3.2"
11
+ version = "1.3.3"
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.2',
43
+ version='1.3.3',
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