XanaduAI / thewalrus

A library for the calculation of hafnians, Hermite polynomials and Gaussian boson sampling.
https://the-walrus.readthedocs.io
Apache License 2.0
99 stars 54 forks source link

do not use __float128 on non-intel platforms #296

Closed brownj85 closed 2 years ago

brownj85 commented 2 years ago

Context: Aliasing of type __float128 was resulting in build failures on aarch64. This is because the GCC extension that provides this type is not available on aarch64.

Description of the Change: Adds a compiler check in permanent.hpp to prevent aliasing __float128 if the platform is not i386 or AMD64. Other platforms will fall back to double precision.

Benefits: Build will succeed on aarch64.

Possible Drawbacks: To keep the compiler check simple, it will exclude certain exotic architectures that do support __float128, such as PowerPC.

Related GitHub Issues:

290

codecov[bot] commented 2 years ago

Codecov Report

Merging #296 (293ef09) into master (a61c85d) will not change coverage. The diff coverage is n/a.

:exclamation: Current head 293ef09 differs from pull request most recent head 45fef80. Consider uploading reports for the commit 45fef80 to get more accurate results

@@            Coverage Diff            @@
##            master      #296   +/-   ##
=========================================
Coverage   100.00%   100.00%           
=========================================
Files           21        21           
Lines         1451      1458    +7     
=========================================
+ Hits          1451      1458    +7     
Impacted Files Coverage Δ
thewalrus/__init__.py 100.00% <0.00%> (ø)
thewalrus/quantum/fock_tensors.py 100.00% <0.00%> (ø)
thewalrus/_hermite_multidimensional.py 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a61c85d...45fef80. Read the comment docs.

sduquemesa commented 2 years ago

Hi @brownj85, thanks for your contribution! 🚀 I have created a new check so that we test if the build on aarch64 works successfully.

nquesada commented 2 years ago

@brownj85 @sduquemesa note that in the development version of the walrus we do not use C++ for permanents anymore. I think this PR can be closed and just wait til the next release.

thisac commented 2 years ago

Closing this since the dependency on C++ has been removed in the latest release.