Skip to content

Instantly share code, notes, and snippets.

View PhilipVinc's full-sized avatar
🎯
Solving problems...

Filippo Vicentini PhilipVinc

🎯
Solving problems...
View GitHub Profile
{"Output": [{"Sx": {"Mean": 0.9999999169282001, "Variance": 1.862586944649667e-07, "Sigma": 1.1098962439738887e-05, "R_hat": 0.9976736497590734, "TauCorr": 0.0}, "Sy": {"Mean": 5.077493691027381e-05, "Variance": 0.10370042335148308, "Sigma": 0.008281602265203468, "R_hat": 1.003089244834029, "TauCorr": 0.0}, "Sz": {"Mean": -0.0048941798941798936, "Variance": 0.10370620573332213, "Sigma": 0.00828183315490214, "R_hat": 1.0031086816827015, "TauCorr": 0.0}, "LdagL": {"Mean": 17.14925977446276, "Variance": 223.72984547380884, "Sigma": 0.2521810040464449, "R_hat": 1.0002016738591837, "TauCorr": 0.06963744988539322}, "Iteration": 0}, {"Sx": {"Mean": 0.8883244213563494, "Variance": 0.0073810615431987, "Sigma": 0.002209446641081766, "R_hat": 1.0020263155675062, "TauCorr": 0.0}, "Sy": {"Mean": 0.032671567827953656, "Variance": 0.08862480162138474, "Sigma": 0.0076559967859600175, "R_hat": 1.001262256781352, "TauCorr": 0.0}, "Sz": {"Mean": -0.1997354497354497, "Variance": 0.09846553847876598, "Sigma": 0.008069864350415346
# Note that this script can accept some limited command-line arguments, run
# `julia build_tarballs.jl --help` to see a usage message.
using BinaryBuilder, Pkg
name = "SPIRV_Cross"
version = v"1.0.0"
# Collection of sources required to complete build
sources = [
GitSource("https://github.com/KhronosGroup/SPIRV-Cross.git", "6637610b16aacfe43c77ad4060da62008a83cd12")
@PhilipVinc
PhilipVinc / meta.yaml
Last active March 25, 2020 18:02
Conda recipe for Netket
{% set name = "netket" %}
{% set version = "2.1" %}
package:
name: "{{ name|lower }}"
version: "{{ version }}"
source:
#url: https://github.com/netket/netket/tree/v2.1
#sha256: ea1506f0350a231f623e3e01cc76daaede98d0ce4d2663270975f04169b37665
(netket) [vicentinif@master0 netket]$ mkdir build
(netket) [vicentinif@master0 netket]$ cd build/
(netket) [vicentinif@master0 build]$ ls
(netket) [vicentinif@master0 build]$ cmake .
CMake Error: The source directory "/home/vicentinif/netket_compile/netket/build" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
(netket) [vicentinif@master0 build]$ cmake ..
-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.0
-- Check for working C compiler: /home/vicentinif/.conda/envs/netket/bin/x86_64-conda_cos6-linux-gnu-cc
➜ pip install .
Processing /Users/filippovicentini/Desktop/condaket/nk
Requirement already satisfied: numpy>=1.16 in /Users/filippovicentini/anaconda3/envs/netket_env/lib/python3.7/site-packages (from netket==2.1b1) (1.18.1)
Collecting cmake>=3.10.3
Using cached https://files.pythonhosted.org/packages/cb/e6/253c06edd9848a2f7262b317cde02767da818cf023da93c00d3d43f72780/cmake-3.15.3-py3-none-macosx_10_6_x86_64.whl
Requirement already satisfied: scipy>=1.2.1 in /Users/filippovicentini/anaconda3/envs/netket_env/lib/python3.7/site-packages (from netket==2.1b1) (1.3.1)
Requirement already satisfied: mpi4py>=3.0.1 in /Users/filippovicentini/anaconda3/envs/netket_env/lib/python3.7/site-packages (from netket==2.1b1) (3.0.3)
Building wheels for collected packages: netket
Building wheel for netket (setup.py) ... error
ERROR: Command errored out with exit status 1:
using UnsafeArrays
struct ThreadsCommunicator{A,B,C}
status::A
passthrough::B
nthreads::C
end
function ThreadsCommunicator()
return ThreadsCommunicator(
@PhilipVinc
PhilipVinc / QuantumOptics.jl
Last active September 25, 2019 13:14
Benchmark QuantumOptics.jl
module QuantumOptics
using TimerOutputs
to = TimerOutput()
@timeit to "using" using SparseArrays, LinearAlgebra
export bases, Basis, GenericBasis, CompositeBasis, basis,
tensor, ⊗, permutesystems, @samebases,
states, StateVector, Bra, Ket, basisstate, norm,
@PhilipVinc
PhilipVinc / zygote_crash.jl
Created September 19, 2019 18:26
Zygote crashes trying to convert complex to float.
using Zygote
using LinearAlgebra, Statistics
# Create a state of index i
function make_state(i, Nsites)
@assert i<=2^Nsites && i>0
i = i-1
v = Zygote.Buffer(zeros(ComplexF64, Nsites))
for j=1:Nsites
i, loc = divrem(i,2)
@PhilipVinc
PhilipVinc / test_read.jl
Last active July 5, 2019 16:14
Read data from tensor board back into Julia
using TensorBoardLogger, Logging, ValueHistories
function read_event(f::IOStream)
header = read(f, 8)
crc_header = read(f, 4)
# check
crc_header_ck = reinterpret(UInt8, UInt32[TensorBoardLogger.masked_crc32c(header)])
@assert crc_header == crc_header_ck
@PhilipVinc
PhilipVinc / minresqlp.jl
Created March 13, 2019 11:20
Minres-QLP
export minresqlp_iterable, minresqlp, minresqlp!
using Printf
import LinearAlgebra: BLAS.axpy!, givensAlgorithm
import Base: iterate
mutable struct MINRESQLPIterable{matT, solT, vecT <: DenseVector, shiftT<: Number, realT <: Real}
A::matT
shift::shiftT
skew_hermitian::Bool
x::solT