quest-kit / quest Goto Github PK
View Code? Open in Web Editor NEWA multithreaded, distributed, GPU-accelerated simulator of quantum computers
Home Page: https://quest.qtechtheory.org/
License: MIT License
A multithreaded, distributed, GPU-accelerated simulator of quantum computers
Home Page: https://quest.qtechtheory.org/
License: MIT License
Since this is the number of qubits suggested by the dimensions of the state-vector, which is twice too many when the register is storing a density matrix (and should instead refer to numDensityQubits
).
Consider renaming
numDensityQubits
-> numQubitsRepresented
numQubits
-> numQubitsInStateVec
Still seems hacky and gross ¯\(ツ)/¯
It would be great to run some C formatter on the source code, just to make it a bit more uniform, just as in places there is code like
void example(){
}
then something like
void example() {
}
or
void example()
{
}
It would just make the source a little more readable, but thats just my preference!
I will do a pull request, but please fell free to ignore if needed, if you think it's not necessary.
This shouldn't be too hard to make contiguous, making it much faster due by reducing caches
What is currently
combineDensityMatrices(0.3, targQureg, 0.7, otherQureg);
should become
addDensityMatrix(targQureg, 0.7, otherQureg);
or something
It's especially important to unit test with many different numbers of machines, since some code has different logic based on whether contiguous amplitude sets fit entirely into a chunk.
getRealAmpEl
getImagAmpEl
getProbEl
Also, should exist getAmplitude
which returns Complex for state-vectors.
initStatePlus
-> initPlusState
initStateZero
-> initZeroState
initClassicalState
and initPureState
.init
the best prefix?This involves scaling the input (so that, e.g. maximum dephasing occurs when an argument of 0.5 [probability of X] is passed) and adding new validation to restrict probs to be below their max-mixing values.
These lines:
sizeHalfBlock = 1LL << targetQubit;
sizeBlock = 2LL * sizeHalfBlock;
and
thisBlock = thisTask / sizeHalfBlock;
indexUp = thisBlock*sizeBlock + thisTask%sizeHalfBlock;
indexLo = indexUp + sizeHalfBlock;
are duplicated in almost every *Local function in QuEST_cpu.c.
Should they instead be fetched by something like
getStateVecIndices(targetQubit, thisTask, &indexUp, &indexLo)
Should this be a global constant if its the safe for all kernels?
Only some runtimes - I've probably goofed up some pointer
Lets the user supply amplitudes to set in the (possibly distributed) state-vector.
Something like
initStateByAmps(reg, reals, imags, numAmps, startInd)
would allow writing chunks at a time, needed when distributed.
tGate, sGate and sigmaZ can then be calculated error-free
phaseFlip should then wrap phaseShift in QuEST_common.c
Why should we make the user supply a reference to the struct in the stack, when the create... and init... funcitons could just as easily malloc space for the struct in the heap and return that?
We already require explicit freeing functions to free their dynamic attribs.
This would mean the creation of these structs is in one line...
QubitRegister* qureg = createQubitRegister(5);
as opposed to
QubitRegister qureg;
createQubitRegister(&qureg, 5);
It also means the users naturally have a handle to a pointer rather than the struct - all gate functions could then consistently accept a pointer (to be negligably more efficient by not having to copy the struct fields).
E.g. we currently do
QubitRegister qureg;
createQubitRegister(&qureg, 5);
initStateZero(qureg);
but could instead do
QubitRegister* qureg = createQubitRegister(5);
initStateZero(qureg);
where initStateZero
now accepts a pointer.
Need rigorous testing for density matrices
Even in quad precision, brings trace from 1 to 0.95.
All other density matrix functions are supported on all platforms.
Should summing probabilities be done by reduction?
Otherwise, should mixed_findProbabilityOfOutcome also just iterate with Kahan summation?
E.g. initQuESTEnv
Make the method robust against this
They currently have no doc comment in QuEST.h
QuESTAsserts should be in e.g. QuEST_ops, rather in a hardware backend (e.g. QuEST_gpu) which leads to code duplication.
Since we allow user source code to be either C or C++ for GPU QuEST.
Possible now that gates have a central, hardware-agnostic place in QuEST_ops.h
Also shorten QASM REAL strings
Test 7 Hadamard fails when QuEST_PREC=1 (4 bytes)
controlledSigmaX is implemented with controlledNot, and controlledSigmaZ is implemented with controlledPhaseFlip
Currently, these are
densmatr_initPureState
densmatr_collapseToKnownProbOutcome
densmatr_collapseToKnownProbOutcome
the density analogs of the debugging functions (if necessary)
initStateDebug
initStateFromSingleFile
initStateOfSingleQubit
reportStateToScreen
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.