Quantum computer simulator library
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples Commenting some examples Nov 16, 2018
img Added atom img files Nov 16, 2018
include Removed unused operations.h file Nov 16, 2018
.gitignore removed test files Nov 16, 2018
README.md Added 'library' to readme Nov 16, 2018



Quantum computer simulator library

I'm building this to learn C++ and Quantum Information Theory simultaneously, so don't be surprised if they're both wrong. Instead, feel free to create a new issue or a new pull request so you can rub in exactly what I did wrong in a concise, well commented manner.

Thanks x



  • C++14


Download or clone qSim-cpp into some/directory/qSim

Usage example

// A confused qubit
// confused.cpp

#include "qSim.h"

using namespace qsim;

int main() {
    // initialize a |0> qubit
    math::Ket qubit = states::z0;

    std::cout << "qubit:\n";

    // apply a Hadamard gate to qubit
    qubit *= gates::H;

    std::cout << "confused qubit:\n";

From this directory, compile confused.cpp using your compiler of choice:

$ g++ -std=c++14 -I some/directory/qSim/include confused.cpp -o confused

Then run your compiled file:

$ ./confused

Should output something like:


| 1 |
| 0 |

confused qubit:

| 0.707 |
| 0.707 |

For more examples and usage, please refer to the examples.

Release History

  • 0.0.1
    • Work in progress


Hayk Khachatryan – chat w/ mehi@hayk.io

Distributed under the MIT license. See LICENSE for more information.



  1. Fork it (https://github.com/haykkh/qSim-cpp/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request