Comments (11)
Hi @amanuelanteneh, thanks for reporting this.
Can you please post the output of running: import thewalrus; thewalrus.about()
?
Also, if you can post your full code it will make it easier to see if we can reproduce your problem.
from thewalrus.
Hi @CatalinaAlbornoz,
Here is the output of thewalrus.about():
The Walrus: a Python library for for the calculation of hafnians, Hermite polynomials, and Gaussian boson sampling.
Copyright 2018-2021 Xanadu Quantum Technologies Inc.
Python version: 3.8.8
Platform info: Linux-3.10.0-1127.19.1.el7.x86_64-x86_64-with-glibc2.10
Installation path: /home/ph/.local/lib/python3.8/site-packages/thewalrus
The Walrus version: 0.19.0
Numpy version: 1.19.2
Scipy version: 1.5.2
SymPy version: 1.6.2
Numba version: 0.51.2
This is the full function that i use to generate the samples and the only place I use functions from the walrus:
def generateSamples(adjMatrix, numSamples, meanN, displacement, maxPhotons):
modes = adjMatrix.shape[0]
A = adjMatrix
Q = gen_Qmat_from_graph(A, meanN)
V = Covmat(Q, hbar=2) #the covaraince matrix of the pure gaussian state
d = np.full( shape=(2*modes), fill_value=displacement, dtype=np.float64 )
samples = torontonian_sample_state(cov=V, mu=d, samples=numSamples, max_photons=maxPhotons)
return(samples)
It takes in the adjacency matrix of a graph and uses functions from the walrus to embed the matrix into a GBS device which i then sample from. I call this function multiple times for a dataset of graphs. The function seems to run in the expected amount of time when displacement equals 0 but for displacements of 0.1 and 0.25 on each mode the runtime increases very drastically (from about 8 hours to over 7 days) which i don't believe should be the case.
from thewalrus.
Thank you @amanuelanteneh. We will take a look into this.
from thewalrus.
@CatalinaAlbornoz Thanks! It might also be that this isn't how the displacement is meant to be specified however I can't find any example code on how to sample from a displaced Gaussian state using thewalrus so I'm unsure.
from thewalrus.
The slowdown should only be 2x. How many modes are you working with?
from thewalrus.
@ziofil on average the number of nodes in the graphs I'm looking at is about 25 so around 50 modes on average.
from thewalrus.
Those are a lot of modes... I'm wondering if the slowdown is due to other effects (like memory swapping and so on). Could you try with fewer modes and see if the slowdown is the same?
from thewalrus.
also, how sparse is your adjacency matrix?
from thewalrus.
The adjacency matrices range in sparsity but the majority seem fairly sparse.
from thewalrus.
Thank you @amanuelanteneh. Does having fewer modes give you the same slowdown? Or do you have the same slowdown with fewer modes?
from thewalrus.
Hello, I've been running some more simulations and it appears that the issue is no longer a problem. Sorry for the delay in response.
from thewalrus.
Related Issues (20)
- [unitaryhack] Improve the calculation of multidimensional hermite polynomials HOT 10
- Speed up photon number covariance HOT 2
- 'pip install thewalrus' fails in Python 3.9. HOT 5
- Convenience functions to change ordering of quadratures HOT 1
- Why is hbar=2? Physicist may assume hbar=1 HOT 1
- P ( [ ℓ ] ) is not defined. Is it the power set of (0, 1, ...l-1)? HOT 9
- [Thewalrus documentation] The figures in "Basics of Hafnians and Loop Hafnians" are missing HOT 7
- Random interferometer is already implemented in scipy
- [Thewalrus installation] Can not install the version later than 0.15.0 HOT 11
- Add support for calculating the permanent using the BBFG algorithm HOT 4
- Recursive calculation of threshold probabilitites HOT 4
- FTBFS 0.16.2 on aarch64 HOT 5
- I have searched exisisting GitHub issues to make sure the issue does not already exist. HOT 1
- The Qmat functions is off by a complex conjugate
- Library hard crashing when computing BBFG permanent with a 0x0 matrix HOT 4
- Optional arguments in `passive_transformation`
- n_body_marginals is not symmetric
- Tests fail to run: error: unrecognized arguments: --randomly-seed=137 HOT 1
- Banded hafnian algorithm HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from thewalrus.