Giter Site home page Giter Site logo

quest-kit / quest Goto Github PK

View Code? Open in Web Editor NEW
389.0 389.0 137.0 18.03 MB

A multithreaded, distributed, GPU-accelerated simulator of quantum computers

Home Page: https://quest.qtechtheory.org/

License: MIT License

C 33.94% C++ 52.43% Cuda 8.64% CMake 1.39% JavaScript 2.89% HTML 0.15% CSS 0.55%

quest's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

quest's Issues

Rename QubitRegister numQubits field

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 ¯\(ツ)

Code Formatting

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.

Rename some functions

  • getRealAmpEl
  • getImagAmpEl
  • getProbEl

Also, should exist getAmplitude which returns Complex for state-vectors.

  • initStatePlus -> initPlusState
  • initStateZero -> initZeroState
    brings them more in-line with initClassicalState and initPureState.
    Is init the best prefix?

Remove code duplication in OMP parallelism

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)

New feature: initStateFromAmps

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.

New feature: Add error model to MultiQubit object

  • Update the MultiQubit object or add a new MultiQubitWithErrors object that contains information about errors that should be introduced during each operation on the qubit
  • Could be a small error with every operation or a probability of a larger error with each operation

make createQubitRegister and initQuESTEnv return dynamic memory?

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.

New feature, documentation: Add developer guide

  • While internal functions are documented using doxygen, it would be useful to have a higher level description of how the code works, particularly how MPI/non-mpi functionality is handled, for developers

New feature: Add getter for number of amplitudes in state vector

  • The multiqubit object shouldn't be accessed directly as the properties on that object aren't defined in the API. In particular, number of amplitudes means number of amplitudes per MPI rank in the distributed case, which happens to be total number of amplitudes in the whole system in the local case. It will be safer to access the number of amplitudes from an API function

Unit test density matrix operations

  • regular gates (very tedious though - particular attention to measurements)
  • calcFidelity
  • calcPurity
  • calcTotalProbability
  • oneQubitDephase
  • twoQubitDephase
  • oneQubitDepolarise
  • twoQubitDepolarise
  • combineDensityMatrices
  • getDensityAmplitude

New feature: add setters for elements in the state vector

  • While the state vector of probability amplitudes wouldn't be updated in usual use, we have seen cases where the user extends the code by updating this vector directly. This code might break if the program was switched from running locally to running across multiple nodes, so it is safer to offer setters which can handle distributed mode in the API

Add new density matrix functions

  • to add two probability-weighted density matrices (or one pure)
  • explicit trace function (currently calcTotalProbability)
  • trace of density matrix squared
  • fidelity

Implement missing density state functions

Currently, these are

  • CPU MPI densmatr_initPureState
  • CPU MPI densmatr_collapseToKnownProbOutcome
  • CPU local densmatr_collapseToKnownProbOutcome

the density analogs of the debugging functions (if necessary)

  • initStateDebug
  • initStateFromSingleFile
  • initStateOfSingleQubit
  • reportStateToScreen

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.