GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — qpp/examples/qecc.cpp at main · softwareQinc/qpp

Expand file tree

/

qecc.cpp

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
35 lines (26 loc) · 1.11 KB
/

qecc.cpp

Copy path

File metadata and controls

35 lines (26 loc) · 1.11 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Source: ./examples/qecc.cpp
//
// Quantum error correcting codes
#include <iostream>
#include <qpp/qpp.hpp>
int main() {
using namespace qpp;
ket a0 = Codes::codeword(Codes::Type::FIVE_QUBIT, 0);
ket a1 = Codes::codeword(Codes::Type::FIVE_QUBIT, 1);
ket b0 = Codes::codeword(Codes::Type::STEANE_SEVEN_QUBIT, 0);
ket b1 = Codes::codeword(Codes::Type::STEANE_SEVEN_QUBIT, 1);
ket c0 = Codes::codeword(Codes::Type::SHOR_NINE_QUBIT, 0);
ket c1 = Codes::codeword(Codes::Type::SHOR_NINE_QUBIT, 1);
std::cout << ">> [[5, 1, 3]] Five qubit code.\n";
std::cout << ">> Checking codeword orthogonality.\n";
std::cout << ">> |<0L|1L>| = ";
std::cout << disp(adjoint(a0) * a1) << '\n';
std::cout << ">> [[7, 1, 3]] Seven qubit Steane code.\n";
std::cout << ">> Checking codeword orthogonality.\n";
std::cout << ">> |<0L|1L>| = ";
std::cout << disp(adjoint(b0) * b1) << '\n';
std::cout << ">> [[9, 1, 3]] Nine qubit Shor code.\n";
std::cout << ">> Checking codeword orthogonality.\n";
std::cout << ">> |<0L|1L>| = ";
std::cout << disp(adjoint(c0) * c1) << '\n';
}
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.