| loccliff_tables | Inline functions and tables needed by them. Consider them as private |
14 | 1.3.4
15 |
16 |
17 |
--------------------------------------------------------------------------------
/doc/html/structEdge-members.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | | Edge(const VertexIndex a, const VertexIndex b) (defined in Edge) | Edge | [inline] |
13 | 1.3.4
14 |
15 |
16 |
--------------------------------------------------------------------------------
/doc/html/structedge__hash-members.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | | operator()(const Edge &e) const (defined in edge_hash) | edge_hash | [inline] |
13 | 1.3.4
14 |
15 |
16 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # GraphSim
2 |
3 | [](https://travis-ci.org/marcusps/GraphSim)
4 |
5 | This is a git repository for Simon Anders' library to simulate an important class of quantum circuits.
6 |
7 | This code is not actively supported or maintained, but pull requests for minor bug fixes will be accepted.
8 |
9 | > This is GraphSim, a library do simulate stabilizer quantum circuits.
10 | >
11 | > - Author: Simon Anders, sanders@fs.tum.de, University of Innsbruck
12 | > - Version: v.10 (initial release)
13 | > - Date: 1 Feb 2005 (last change), 18 Apr 2005 (release prep)
14 | > - (c) 2005, released under GPL
15 | >
16 | > For information about this package, please read
17 | > - the paper describing the algorithm:
18 | > S. Anders, H. J. Briegel:
19 | > Fast Simulation of Stabilizer Circuits using a Graph State Formalism
20 | > quant-ph/0504117
21 | > - the documentation of the C++ library in doc/html/index.html
22 | > - the documentation of the Python bindings in doc/graphsim_py.html
23 | > - the file COPYING for the text of the GPL
24 | >
25 | > If you use this paper for scientific work, please cite the paper
26 | > referenced above in your publication.
27 |
28 | In case of problems, please submit an issue: https://github.com/marcusps/GraphSim/issues
29 |
30 | This code is not actively supported or maintained, but pull requests for minor bug fixes will be accepted.
31 |
--------------------------------------------------------------------------------
/doc/latex/refman.tex:
--------------------------------------------------------------------------------
1 | \documentclass[a4paper]{book}
2 | \usepackage{a4wide}
3 | \usepackage{makeidx}
4 | \usepackage{fancyhdr}
5 | \usepackage{graphicx}
6 | \usepackage{multicol}
7 | \usepackage{float}
8 | \usepackage{textcomp}
9 | \usepackage{alltt}
10 | \usepackage{doxygen}
11 | \makeindex
12 | \setcounter{tocdepth}{1}
13 | \renewcommand{\footrulewidth}{0.4pt}
14 | \begin{document}
15 | \begin{titlepage}
16 | \vspace*{7cm}
17 | \begin{center}
18 | {\Large graphsim Reference Manual}\\
19 | \vspace*{1cm}
20 | {\large Generated by Doxygen 1.3.4}\\
21 | \vspace*{0.5cm}
22 | {\small Mon Apr 18 16:10:12 2005}\\
23 | \end{center}
24 | \end{titlepage}
25 | \clearemptydoublepage
26 | \pagenumbering{roman}
27 | \tableofcontents
28 | \clearemptydoublepage
29 | \pagenumbering{arabic}
30 | \chapter{graphsim Main Page}
31 | \label{index}\input{index}
32 | \chapter{graphsim Namespace Index}
33 | \input{namespaces}
34 | \chapter{graphsim Class Index}
35 | \input{annotated}
36 | \chapter{graphsim File Index}
37 | \input{files}
38 | \chapter{graphsim Namespace Documentation}
39 | \input{namespaceloccliff__tables}
40 | \chapter{graphsim Class Documentation}
41 | \input{structConnectionInfo}
42 | \include{structEdge}
43 | \include{structedge__hash}
44 | \include{classGraphRegister}
45 | \include{structLocCliffOp}
46 | \include{structQubitVertex}
47 | \include{structRightPhase}
48 | \include{structStabilizer}
49 | \chapter{graphsim File Documentation}
50 | \input{graphsim_8h}
51 | \include{loccliff_8h}
52 | \include{stabilizer_8h}
53 | \printindex
54 | \end{document}
55 |
--------------------------------------------------------------------------------
/doc/html/globals_func.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | 11 |
20 | 1.3.4
21 |
22 |
23 |
--------------------------------------------------------------------------------
/doc/html/files.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | | graphsim.h [code] | |
| loccliff.h [code] | |
| stabilizer.h [code] |
16 | 1.3.4
17 |
18 |
19 |
--------------------------------------------------------------------------------
/doc/html/functions_vars.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | 11 |
21 | 1.3.4
22 |
23 |
24 |
--------------------------------------------------------------------------------
/doc/xml/indexpage.xml:
--------------------------------------------------------------------------------
1 |
2 | 11 |
21 | 1.3.4
22 |
23 |
24 |
--------------------------------------------------------------------------------
/doc/xml/structedge__hash.xml:
--------------------------------------------------------------------------------
1 |
2 | | byprod | QubitVertex | |
| neighbors | QubitVertex | |
| QubitVertex(void) | QubitVertex | [inline] |
15 | 1.3.4
16 |
17 |
18 |
--------------------------------------------------------------------------------
/doc/latex/structRightPhase.tex:
--------------------------------------------------------------------------------
1 | \section{Right\-Phase Struct Reference}
2 | \label{structRightPhase}\index{RightPhase@{RightPhase}}
3 | A phase, which is 0, 90, 180, or 270 degrees.
4 |
5 |
6 | {\tt \#include $<$loccliff.h$>$}
7 |
8 | \subsection*{Public Member Functions}
9 | \begin{CompactItemize}
10 | \item
11 | {\bf Right\-Phase} (void)\label{structRightPhase_a0}
12 |
13 | \begin{CompactList}\small\item\em initializes as 0 degrees \item\end{CompactList}\item
14 | {\bf Right\-Phase} (unsigned short ph\_\-)\label{structRightPhase_a1}
15 |
16 | \begin{CompactList}\small\item\em takes 0..3 as argument and writes it to ph \item\end{CompactList}\item
17 | string {\bf get\_\-name} (void) const \label{structRightPhase_a2}
18 |
19 | \begin{CompactList}\small\item\em returns \char`\"{} +\char`\"{}, \char`\"{} i\char`\"{}, \char`\"{} -\char`\"{}, or \char`\"{}-i\char`\"{} \item\end{CompactList}\end{CompactItemize}
20 | \subsection*{Public Attributes}
21 | \begin{CompactItemize}
22 | \item
23 | unsigned short {\bf ph}
24 | \end{CompactItemize}
25 |
26 |
27 | \subsection{Detailed Description}
28 | A phase, which is 0, 90, 180, or 270 degrees.
29 |
30 |
31 |
32 | \subsection{Member Data Documentation}
33 | \index{RightPhase@{Right\-Phase}!ph@{ph}}
34 | \index{ph@{ph}!RightPhase@{Right\-Phase}}
35 | \subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned short {\bf Right\-Phase::ph}}\label{structRightPhase_o0}
36 |
37 |
38 | to be read modulo 4, i.e. \& 0x03 The field 'ph' indicated the angle with a value 0, 1, 2, or 3, corresponding to 0, 90, 180, or 270 degrees Do not rely on ph$<$3, always read it out anded with 0x03.
39 |
40 | The documentation for this struct was generated from the following files:\begin{CompactItemize}
41 | \item
42 | {\bf loccliff.h}\item
43 | loccliff.cpp\end{CompactItemize}
44 |
--------------------------------------------------------------------------------
/doc/xml/structEdge.xml:
--------------------------------------------------------------------------------
1 |
2 | | non1 (defined in ConnectionInfo) | ConnectionInfo | |
| non2 (defined in ConnectionInfo) | ConnectionInfo | |
| wasEdge (defined in ConnectionInfo) | ConnectionInfo |
15 | 1.3.4
16 |
17 |
18 |
--------------------------------------------------------------------------------
/doc/html/structedge__hash.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | 11 | List of all members.
Public Member Functions | |
| 15 | size_t | operator() (const Edge &e) const |
21 |
26 | 1.3.4
27 |
28 |
29 |
--------------------------------------------------------------------------------
/doc/html/structEdge.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | 11 | List of all members.
Public Member Functions | |
| 15 | | Edge (const VertexIndex a, const VertexIndex b) |
21 |
26 | 1.3.4
27 |
28 |
29 |
--------------------------------------------------------------------------------
/doc/html/structRightPhase-members.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | | get_name(void) const | RightPhase | |
| ph | RightPhase | |
| RightPhase(void) | RightPhase | [inline] |
| RightPhase(unsigned short ph_) | RightPhase | [inline] |
16 | 1.3.4
17 |
18 |
19 |
--------------------------------------------------------------------------------
/doc/latex/structStabilizer.tex:
--------------------------------------------------------------------------------
1 | \section{Stabilizer Struct Reference}
2 | \label{structStabilizer}\index{Stabilizer@{Stabilizer}}
3 | A stabilizer describing a quantum state.
4 |
5 |
6 | {\tt \#include $<$stabilizer.h$>$}
7 |
8 | \subsection*{Public Member Functions}
9 | \begin{CompactItemize}
10 | \item
11 | {\bf Stabilizer} (const {\bf Vertex\-Index} num\-Qubits\_\-)\label{structStabilizer_a0}
12 |
13 | \item
14 | {\bf Stabilizer} (const {\bf Graph\-Register} \&gr, const hash\_\-set$<$ {\bf Vertex\-Index} $>$ \&qubits)\label{structStabilizer_a1}
15 |
16 | \item
17 | {\bf Stabilizer} (QState $\ast$qs)\label{structStabilizer_a2}
18 |
19 | \item
20 | void {\bf add\_\-row} (unsigned target, unsigned addend)\label{structStabilizer_a3}
21 |
22 | \item
23 | void {\bf conjugate} (unsigned row, unsigned col, const {\bf Loc\-Cliff\-Op} trans)\label{structStabilizer_a4}
24 |
25 | \item
26 | void {\bf conjugate\_\-column} (unsigned col, const {\bf Loc\-Cliff\-Op} trans)\label{structStabilizer_a5}
27 |
28 | \item
29 | void {\bf print} (ostream \&os=cout) const \label{structStabilizer_a6}
30 |
31 | \item
32 | bool {\bf compare} (const {\bf Stabilizer} \&diag)\label{structStabilizer_a7}
33 |
34 | \end{CompactItemize}
35 | \subsection*{Public Attributes}
36 | \begin{CompactItemize}
37 | \item
38 | {\bf Vertex\-Index} {\bf num\-Qubits}\label{structStabilizer_o0}
39 |
40 | \item
41 | vector$<$ vector$<$ {\bf Loc\-Cliff\-Op} $>$ $>$ {\bf paulis}\label{structStabilizer_o1}
42 |
43 | \item
44 | vector$<$ {\bf Right\-Phase} $>$ {\bf rowsigns}\label{structStabilizer_o2}
45 |
46 | \item
47 | vector$<$ {\bf Vertex\-Index} $>$ {\bf vtxidx}\label{structStabilizer_o3}
48 |
49 | \end{CompactItemize}
50 |
51 |
52 | \subsection{Detailed Description}
53 | A stabilizer describing a quantum state.
54 |
55 |
56 |
57 | The documentation for this struct was generated from the following files:\begin{CompactItemize}
58 | \item
59 | {\bf stabilizer.h}\item
60 | stabilizer.cpp\end{CompactItemize}
61 |
--------------------------------------------------------------------------------
/doc/html/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | 10 | This is 'graphsim', a simulator for stabilizer quantum cuircuits using the graph state formalism.
11 | graphsim version 0.10, dated 2005-Jan-27
12 | (c) Simon Anders (sanders@fs.tum.de), University of Innsbruck
13 | See the article
14 | S. Anders, H. J. Briegel: Fast simulation of Stabilizer Circuits using a Graph States Formalism quant-ph/0504117
15 | for a description of this software.
16 | ----
17 | This file is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.
18 | This file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
19 | You should have received a copy of the GNU General Public License along with this file; see the file COPYING. If not, browse to http://www.fsf.org/licenses/gpl.html
22 | 1.3.4
23 |
24 |
25 |
--------------------------------------------------------------------------------
/doc/latex/structQubitVertex.tex:
--------------------------------------------------------------------------------
1 | \section{Qubit\-Vertex Struct Reference}
2 | \label{structQubitVertex}\index{QubitVertex@{QubitVertex}}
3 | {\tt \#include $<$graphsim.h$>$}
4 |
5 | \subsection*{Public Member Functions}
6 | \begin{CompactItemize}
7 | \item
8 | {\bf Qubit\-Vertex} (void)
9 | \end{CompactItemize}
10 | \subsection*{Public Attributes}
11 | \begin{CompactItemize}
12 | \item
13 | {\bf Loc\-Cliff\-Op} {\bf byprod}
14 | \item
15 | hash\_\-set$<$ {\bf Vertex\-Index} $>$ {\bf neighbors}
16 | \end{CompactItemize}
17 |
18 |
19 | \subsection{Detailed Description}
20 | A {\bf Graph\-Register}{\rm (p.\,\pageref{classGraphRegister})} object maintains a list of its vertices (qubits), each described by an object of the class Qubit\-Vertex described here.
21 |
22 |
23 |
24 | \subsection{Constructor \& Destructor Documentation}
25 | \index{QubitVertex@{Qubit\-Vertex}!QubitVertex@{QubitVertex}}
26 | \index{QubitVertex@{QubitVertex}!QubitVertex@{Qubit\-Vertex}}
27 | \subsubsection{\setlength{\rightskip}{0pt plus 5cm}Qubit\-Vertex::Qubit\-Vertex (void)\hspace{0.3cm}{\tt [inline]}}\label{structQubitVertex_a0}
28 |
29 |
30 | Upon construction, a qubit vertex is initialised with the Hadamard operation as VOp, and with wmpty neighbor list. This makes it represent a $|$0$>$.
31 |
32 | \subsection{Member Data Documentation}
33 | \index{QubitVertex@{Qubit\-Vertex}!byprod@{byprod}}
34 | \index{byprod@{byprod}!QubitVertex@{Qubit\-Vertex}}
35 | \subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Loc\-Cliff\-Op} {\bf Qubit\-Vertex::byprod}}\label{structQubitVertex_o0}
36 |
37 |
38 | byprod is the vertex operator (VOp) associated with the qubit (the name stems from the term 'byproduct operator' used for the similar concept in the one-way quantum computer. \index{QubitVertex@{Qubit\-Vertex}!neighbors@{neighbors}}
39 | \index{neighbors@{neighbors}!QubitVertex@{Qubit\-Vertex}}
40 | \subsubsection{\setlength{\rightskip}{0pt plus 5cm}hash\_\-set$<${\bf Vertex\-Index}$>$ {\bf Qubit\-Vertex::neighbors}}\label{structQubitVertex_o1}
41 |
42 |
43 | neigbors is the adjacency list for this vertex
44 |
45 | The documentation for this struct was generated from the following file:\begin{CompactItemize}
46 | \item
47 | {\bf graphsim.h}\end{CompactItemize}
48 |
--------------------------------------------------------------------------------
/doc/latex/doxygen.sty:
--------------------------------------------------------------------------------
1 | \NeedsTeXFormat{LaTeX2e}
2 | \ProvidesPackage{doxygen}
3 | \RequirePackage{calc}
4 | \RequirePackage{array}
5 | \pagestyle{fancyplain}
6 | \newcommand{\clearemptydoublepage}{\newpage{\pagestyle{empty}\cleardoublepage}}
7 | \renewcommand{\chaptermark}[1]{\markboth{#1}{}}
8 | \renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}
9 | \lhead[\fancyplain{}{\bfseries\thepage}]
10 | {\fancyplain{}{\bfseries\rightmark}}
11 | \rhead[\fancyplain{}{\bfseries\leftmark}]
12 | {\fancyplain{}{\bfseries\thepage}}
13 | \rfoot[\fancyplain{}{\bfseries\scriptsize Generated on Mon Apr 18 16:10:12 2005 for graphsim by Doxygen }]{}
14 | \lfoot[]{\fancyplain{}{\bfseries\scriptsize Generated on Mon Apr 18 16:10:12 2005 for graphsim by Doxygen }}
15 | \cfoot{}
16 | \newenvironment{CompactList}
17 | {\begin{list}{}{
18 | \setlength{\leftmargin}{0.5cm}
19 | \setlength{\itemsep}{0pt}
20 | \setlength{\parsep}{0pt}
21 | \setlength{\topsep}{0pt}
22 | \renewcommand{\makelabel}{}}}
23 | {\end{list}}
24 | \newenvironment{CompactItemize}
25 | {
26 | \begin{itemize}
27 | \setlength{\itemsep}{-3pt}
28 | \setlength{\parsep}{0pt}
29 | \setlength{\topsep}{0pt}
30 | \setlength{\partopsep}{0pt}
31 | }
32 | {\end{itemize}}
33 | \newcommand{\PBS}[1]{\let\temp=\\#1\let\\=\temp}
34 | \newlength{\tmplength}
35 | \newenvironment{TabularC}[1]
36 | {
37 | \setlength{\tmplength}
38 | {\linewidth/(#1)-\tabcolsep*2-\arrayrulewidth*(#1+1)/(#1)}
39 | \par\begin{tabular*}{\linewidth}
40 | {*{#1}{|>{\PBS\raggedright\hspace{0pt}}p{\the\tmplength}}|}
41 | }
42 | {\end{tabular*}\par}
43 | \newcommand{\entrylabel}[1]{
44 | {\parbox[b]{\labelwidth-4pt}{\makebox[0pt][l]{\textbf{#1}}\\}}}
45 | \newenvironment{Desc}
46 | {\begin{list}{}
47 | {
48 | \settowidth{\labelwidth}{40pt}
49 | \setlength{\leftmargin}{\labelwidth}
50 | \setlength{\parsep}{0pt}
51 | \setlength{\itemsep}{-4pt}
52 | \renewcommand{\makelabel}{\entrylabel}
53 | }
54 | }
55 | {\end{list}}
56 | \newenvironment{Indent}
57 | {\begin{list}{}{\setlength{\leftmargin}{0.5cm}}
58 | \item[]\ignorespaces}
59 | {\unskip\end{list}}
60 | \setlength{\parindent}{0cm}
61 | \setlength{\parskip}{0.2cm}
62 | \addtocounter{secnumdepth}{1}
63 | \sloppy
64 | \usepackage[T1]{fontenc}
65 |
--------------------------------------------------------------------------------
/doc/html/structConnectionInfo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | #include <graphsim.h>
9 | 10 | List of all members.
Public Attributes | |
| 14 | bool | wasEdge |
| 17 | bool | non1 |
| 20 | bool | non2 |
26 |
31 | 1.3.4
32 |
33 |
34 |
--------------------------------------------------------------------------------
/doc/html/annotated.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | | ConnectionInfo | |
| Edge | This structure is needed only by toggle_edges |
| edge_hash | This structure is needed only by toggle_edges |
| GraphRegister | A quantum register |
| LocCliffOp | An operator in the local Clifford group |
| QubitVertex | |
| RightPhase | A phase, which is 0, 90, 180, or 270 degrees |
| Stabilizer | A stabilizer describing a quantum state |
21 | 1.3.4
22 |
23 |
24 |
--------------------------------------------------------------------------------
/stabilizer.h:
--------------------------------------------------------------------------------
1 | // stabilizer.h
2 |
3 | /*!\file
4 | defines the Stabilizer class */
5 |
6 | #ifndef STABILIZER_H
7 | #define STABILIZER_H
8 |
9 | #include #include <iostream>#include <vector>#include <cassert>#include "loccliff.h"#include <ext/hash_set>15 | Go to the source code of this file.
Classes | |
| struct | QState |
| struct | Stabilizer |
| A stabilizer describing a quantum state. More... | |
Typedefs | |
| 25 | typedef unsigned long | VertexIndex |
32 | 1.3.4
33 |
34 |
35 |
--------------------------------------------------------------------------------
/doc/latex/namespaceloccliff__tables.tex:
--------------------------------------------------------------------------------
1 | \section{loccliff\_\-tables Namespace Reference}
2 | \label{namespaceloccliff__tables}\index{loccliff_tables@{loccliff\_\-tables}}
3 | Inline functions and tables needed by them. Consider them as private.
4 |
5 |
6 | \subsection*{Variables}
7 | \begin{CompactItemize}
8 | \item
9 | const unsigned short {\bf meas\_\-conj\_\-tbl} [3][{\bf num\_\-Loc\-Cliff\-Ops}]
10 | \item
11 | const unsigned short {\bf lco\_\-mult\_\-tbl} [{\bf num\_\-Loc\-Cliff\-Ops}][{\bf num\_\-Loc\-Cliff\-Ops}]\label{namespaceloccliff__tables_a1}
12 |
13 | \item
14 | const short {\bf adj\_\-tbl} [24]
15 | \item
16 | const short {\bf phase\_\-tbl} [4][4]
17 | \end{CompactItemize}
18 |
19 |
20 | \subsection{Detailed Description}
21 | Inline functions and tables needed by them. Consider them as private.
22 |
23 | \subsection{Variable Documentation}
24 | \index{loccliff_tables@{loccliff\_\-tables}!adj_tbl@{adj\_\-tbl}}
25 | \index{adj_tbl@{adj\_\-tbl}!loccliff_tables@{loccliff\_\-tables}}
26 | \subsubsection{\setlength{\rightskip}{0pt plus 5cm}const short loccliff\_\-tables::adj\_\-tbl[24]}\label{namespaceloccliff__tables_a2}
27 |
28 |
29 | {\bf Initial value:}
30 |
31 | \footnotesize\begin{verbatim}
32 | { 0, 1, 2, 3,
33 | 4, 6, 5, 7,
34 | 8, 11, 10, 9,
35 | 12, 13, 15, 14,
36 | 20, 22, 23, 21,
37 | 16, 19, 17, 18}
38 | \end{verbatim}\normalsize
39 | \index{loccliff_tables@{loccliff\_\-tables}!meas_conj_tbl@{meas\_\-conj\_\-tbl}}
40 | \index{meas_conj_tbl@{meas\_\-conj\_\-tbl}!loccliff_tables@{loccliff\_\-tables}}
41 | \subsubsection{\setlength{\rightskip}{0pt plus 5cm}const unsigned short loccliff\_\-tables::meas\_\-conj\_\-tbl[3][{\bf num\_\-Loc\-Cliff\-Ops}]}\label{namespaceloccliff__tables_a0}
42 |
43 |
44 | {\bf Initial value:}
45 |
46 | \footnotesize\begin{verbatim}
47 | {{1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3},
48 | {2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1},
49 | {3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2}}
50 | \end{verbatim}\normalsize
51 | \index{loccliff_tables@{loccliff\_\-tables}!phase_tbl@{phase\_\-tbl}}
52 | \index{phase_tbl@{phase\_\-tbl}!loccliff_tables@{loccliff\_\-tables}}
53 | \subsubsection{\setlength{\rightskip}{0pt plus 5cm}const short loccliff\_\-tables::phase\_\-tbl[4][4]}\label{namespaceloccliff__tables_a3}
54 |
55 |
56 | {\bf Initial value:}
57 |
58 | \footnotesize\begin{verbatim}
59 | {{0, 0, 0, 0},
60 | {0, 0, 1, 3},
61 | {0, 3, 0, 1},
62 | {0, 1, 3, 0}}
63 | \end{verbatim}\normalsize
64 |
--------------------------------------------------------------------------------
/doc/html/globals_vars.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | 11 |
34 | 1.3.4
35 |
36 |
37 |
--------------------------------------------------------------------------------
/doc/xml/structConnectionInfo.xml:
--------------------------------------------------------------------------------
1 |
2 | | conjugate(const LocCliffOp trans) | LocCliffOp | |
| get_matrix(void) const (defined in LocCliffOp) | LocCliffOp | |
| get_name(void) const | LocCliffOp | |
| herm_adjoint(void) const | LocCliffOp | [inline] |
| is_diagonal(void) const | LocCliffOp | [inline] |
| isXY(void) const | LocCliffOp | [inline] |
| LocCliffOp(unsigned short int op_) | LocCliffOp | [inline] |
| LocCliffOp(unsigned short int signsymb, unsigned short int permsymb) | LocCliffOp | [inline] |
| mult_phase(LocCliffOp op1, LocCliffOp op2) | LocCliffOp | [inline, static] |
| op | LocCliffOp |
22 | 1.3.4
23 |
24 |
25 |
--------------------------------------------------------------------------------
/doc/html/functions_func.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | 11 |
39 | 1.3.4
40 |
41 |
42 |
--------------------------------------------------------------------------------
/doc/html/globals.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | 11 | Here is a list of all documented file members with links to the documentation:
43 | 1.3.4
44 |
45 |
46 |
--------------------------------------------------------------------------------
/doc/html/functions.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | 11 | Here is a list of all documented class members with links to the class documentation for each member:
44 | 1.3.4
45 |
46 |
47 |
--------------------------------------------------------------------------------
/doc/html/structStabilizer-members.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | | add_row(unsigned target, unsigned addend) (defined in Stabilizer) | Stabilizer | |
| compare(const Stabilizer &diag) (defined in Stabilizer) | Stabilizer | |
| conjugate(unsigned row, unsigned col, const LocCliffOp trans) (defined in Stabilizer) | Stabilizer | |
| conjugate_column(unsigned col, const LocCliffOp trans) (defined in Stabilizer) | Stabilizer | |
| numQubits (defined in Stabilizer) | Stabilizer | |
| paulis (defined in Stabilizer) | Stabilizer | |
| print(ostream &os=cout) const (defined in Stabilizer) | Stabilizer | |
| rowsigns (defined in Stabilizer) | Stabilizer | |
| Stabilizer(const VertexIndex numQubits_) (defined in Stabilizer) | Stabilizer | |
| Stabilizer(const GraphRegister &gr, const hash_set< VertexIndex > &qubits) (defined in Stabilizer) | Stabilizer | |
| Stabilizer(QState *qs) (defined in Stabilizer) | Stabilizer | |
| vtxidx (defined in Stabilizer) | Stabilizer |
24 | 1.3.4
25 |
26 |
27 |
--------------------------------------------------------------------------------
/doc/html/structRightPhase.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 | #include <loccliff.h>
12 |
13 | List of all members.
Public Member Functions | |
| 17 | | RightPhase (void) |
| initializes as 0 degrees | |
| 21 | | RightPhase (unsigned short ph_) |
| takes 0..3 as argument and writes it to ph | |
| 25 | string | get_name (void) const |
| returns " +", " i", " -", or "-i" | |
Public Attributes | |
| unsigned short | ph |
35 |
37 |
40 |
|
45 |
| 50 | 51 | | 52 |
53 |
54 | 55 | to be read modulo 4, i.e. & 0x03 The field 'ph' indicated the angle with a value 0, 1, 2, or 3, corresponding to 0, 90, 180, or 270 degrees Do not rely on ph<3, always read it out anded with 0x03. |
56 |
63 | 1.3.4
64 |
65 |
66 |
--------------------------------------------------------------------------------
/doc/latex/structLocCliffOp.tex:
--------------------------------------------------------------------------------
1 | \section{Loc\-Cliff\-Op Struct Reference}
2 | \label{structLocCliffOp}\index{LocCliffOp@{LocCliffOp}}
3 | An operator in the local Clifford group.
4 |
5 |
6 | {\tt \#include $<$loccliff.h$>$}
7 |
8 | \subsection*{Public Member Functions}
9 | \begin{CompactItemize}
10 | \item
11 | {\bf Loc\-Cliff\-Op} (unsigned short int op\_\-)\label{structLocCliffOp_a0}
12 |
13 | \begin{CompactList}\small\item\em constructor, takes an integer in 0..23. \item\end{CompactList}\item
14 | {\bf Loc\-Cliff\-Op} (unsigned short int signsymb, unsigned short int permsymb)
15 | \begin{CompactList}\small\item\em constructor, takes a sign symbol in 0..3 (for I, X, Y, Z) and a \item\end{CompactList}\item
16 | string {\bf get\_\-name} (void) const \label{structLocCliffOp_a2}
17 |
18 | \begin{CompactList}\small\item\em returns something like e.g. \char`\"{}YC\char`\"{} for Hadamard=Y$^\wedge$C \item\end{CompactList}\item
19 | {\bf Right\-Phase} {\bf conjugate} (const {\bf Loc\-Cliff\-Op} trans)
20 | \begin{CompactList}\small\item\em replaces op by trans $\ast$ op $\ast$ trans$^\wedge$dagger and returns a phase, \item\end{CompactList}\item
21 | {\bf Loc\-Cliff\-Op} {\bf herm\_\-adjoint} (void) const \label{structLocCliffOp_a4}
22 |
23 | \begin{CompactList}\small\item\em returns the Hermitian adjoint of op \item\end{CompactList}\item
24 | bool {\bf is\-XY} (void) const \label{structLocCliffOp_a5}
25 |
26 | \begin{CompactList}\small\item\em returns True if op is XA or YA. \item\end{CompactList}\item
27 | bool {\bf is\_\-diagonal} (void) const \label{structLocCliffOp_a6}
28 |
29 | \begin{CompactList}\small\item\em returns True if op is an operator diagonal in the computational basis \item\end{CompactList}\item
30 | Right\-Matrix {\bf get\_\-matrix} (void) const \label{structLocCliffOp_a7}
31 |
32 | \end{CompactItemize}
33 | \subsection*{Static Public Member Functions}
34 | \begin{CompactItemize}
35 | \item
36 | {\bf Right\-Phase} {\bf mult\_\-phase} ({\bf Loc\-Cliff\-Op} op1, {\bf Loc\-Cliff\-Op} op2)\label{structLocCliffOp_e0}
37 |
38 | \begin{CompactList}\small\item\em returns the phase of the multiplication of op1 $\ast$ op2 \item\end{CompactList}\end{CompactItemize}
39 | \subsection*{Public Attributes}
40 | \begin{CompactItemize}
41 | \item
42 | unsigned short {\bf op}
43 | \end{CompactItemize}
44 |
45 |
46 | \subsection{Detailed Description}
47 | An operator in the local Clifford group.
48 |
49 |
50 |
51 | \subsection{Constructor \& Destructor Documentation}
52 | \index{LocCliffOp@{Loc\-Cliff\-Op}!LocCliffOp@{LocCliffOp}}
53 | \index{LocCliffOp@{LocCliffOp}!LocCliffOp@{Loc\-Cliff\-Op}}
54 | \subsubsection{\setlength{\rightskip}{0pt plus 5cm}Loc\-Cliff\-Op::Loc\-Cliff\-Op (unsigned short int {\em signsymb}, unsigned short int {\em permsymb})\hspace{0.3cm}{\tt [inline]}}\label{structLocCliffOp_a1}
55 |
56 |
57 | constructor, takes a sign symbol in 0..3 (for I, X, Y, Z) and a
58 |
59 | permutation symbol 0..5 (for A, B, ..., F)
60 |
61 | \subsection{Member Function Documentation}
62 | \index{LocCliffOp@{Loc\-Cliff\-Op}!conjugate@{conjugate}}
63 | \index{conjugate@{conjugate}!LocCliffOp@{Loc\-Cliff\-Op}}
64 | \subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Right\-Phase} Loc\-Cliff\-Op::conjugate (const {\bf Loc\-Cliff\-Op} {\em trans})}\label{structLocCliffOp_a3}
65 |
66 |
67 | replaces op by trans $\ast$ op $\ast$ trans$^\wedge$dagger and returns a phase,
68 |
69 | either +1 or -1 (as Right\-Phase(0) or Right\-Phase(2))
70 |
71 | \subsection{Member Data Documentation}
72 | \index{LocCliffOp@{Loc\-Cliff\-Op}!op@{op}}
73 | \index{op@{op}!LocCliffOp@{Loc\-Cliff\-Op}}
74 | \subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned short {\bf Loc\-Cliff\-Op::op}}\label{structLocCliffOp_o0}
75 |
76 |
77 | The field 'op' identifies the operator. 0 is identity I, 1 is Pauli X, 2 is Pauli Y, 3 is Pauli Z, 4 is I$^\wedge$B, 5 is I$^\wedge$C etc.
78 |
79 | The documentation for this struct was generated from the following files:\begin{CompactItemize}
80 | \item
81 | {\bf loccliff.h}\item
82 | loccliff.cpp\end{CompactItemize}
83 |
--------------------------------------------------------------------------------
/doc/latex/graphsim_8h.tex:
--------------------------------------------------------------------------------
1 | \section{graphsim.h File Reference}
2 | \label{graphsim_8h}\index{graphsim.h@{graphsim.h}}
3 | {\tt \#include $<$iostream$>$}\par
4 | {\tt \#include $<$stdlib.h$>$}\par
5 | {\tt \#include $<$vector$>$}\par
6 | {\tt \#include $<$cassert$>$}\par
7 | {\tt \#include \char`\"{}loccliff.h\char`\"{}}\par
8 | {\tt \#include \char`\"{}stabilizer.h\char`\"{}}\par
9 | \subsection*{Namespaces}
10 | \begin{CompactItemize}
11 | \item
12 | namespace {\bf std}
13 | \end{CompactItemize}
14 | \subsection*{Classes}
15 | \begin{CompactItemize}
16 | \item
17 | struct {\bf Connection\-Info}
18 | \item
19 | class {\bf Graph\-Register}
20 | \begin{CompactList}\small\item\em A quantum register. \item\end{CompactList}\item
21 | struct {\bf Qubit\-Vertex}
22 | \end{CompactItemize}
23 | \subsection*{Defines}
24 | \begin{CompactItemize}
25 | \item
26 | \#define {\bf DBGOUT}(a)\label{graphsim_8h_a0}
27 |
28 | \end{CompactItemize}
29 | \subsection*{Typedefs}
30 | \begin{CompactItemize}
31 | \item
32 | typedef unsigned long {\bf Vertex\-Index}
33 | \item
34 | typedef vector$<$ {\bf Qubit\-Vertex} $>$::iterator {\bf Vertex\-Iter}
35 | \item
36 | typedef hash\_\-set$<$ {\bf Vertex\-Index} $>$::iterator {\bf Vtx\-Idx\-Iter}
37 | \item
38 | typedef vector$<$ {\bf Qubit\-Vertex} $>$::const\_\-iterator {\bf Vertex\-Iter\-Const}
39 | \item
40 | typedef hash\_\-set$<$ {\bf Vertex\-Index} $>$::const\_\-iterator {\bf Vtx\-Idx\-Iter\-Const}
41 | \end{CompactItemize}
42 |
43 |
44 | \subsection{Detailed Description}
45 | This header file defines the main interface of graphsim.
46 |
47 | (c) Simon Anders, University of Innsbruck, 2005 released under GPL.
48 |
49 | Note: If you have trouble compiling this, please note: This file uses the \char`\"{}hash\_\-set\char`\"{} template, which is an extension to the Standard C++ Library and the Standard Template Library, specified by SGI. Most C++ compilers have this template. For GNU C++, the header file $<$ext/hash\_\-set$>$ hasa to be included and hash\_\-set has to be prefixed with namespace \_\-\_\-gnu\_\-cxx. If you use another compiler, you might have to change the include file and the namespace identifier.
50 |
51 | \subsection{Typedef Documentation}
52 | \index{graphsim.h@{graphsim.h}!VertexIndex@{VertexIndex}}
53 | \index{VertexIndex@{VertexIndex}!graphsim.h@{graphsim.h}}
54 | \subsubsection{\setlength{\rightskip}{0pt plus 5cm}typedef unsigned long {\bf Vertex\-Index}}\label{graphsim_8h_a1}
55 |
56 |
57 | All vertices in a graph state are numbered beginning with 0. To specify auch an index, the type Vertex\-Index (which is just unsigned long) is always used \index{graphsim.h@{graphsim.h}!VertexIter@{VertexIter}}
58 | \index{VertexIter@{VertexIter}!graphsim.h@{graphsim.h}}
59 | \subsubsection{\setlength{\rightskip}{0pt plus 5cm}typedef vector$<${\bf Qubit\-Vertex}$>$::iterator {\bf Vertex\-Iter}}\label{graphsim_8h_a2}
60 |
61 |
62 | As we often iterate over sublists of {\bf Graph\-Register::vertices}{\rm (p.\,\pageref{classGraphRegister_o0})}, this iterator typedef is a handy abbreviation. \index{graphsim.h@{graphsim.h}!VertexIterConst@{VertexIterConst}}
63 | \index{VertexIterConst@{VertexIterConst}!graphsim.h@{graphsim.h}}
64 | \subsubsection{\setlength{\rightskip}{0pt plus 5cm}typedef vector$<${\bf Qubit\-Vertex}$>$::const\_\-iterator {\bf Vertex\-Iter\-Const}}\label{graphsim_8h_a4}
65 |
66 |
67 | A constant version of Vertex\-Iter \index{graphsim.h@{graphsim.h}!VtxIdxIter@{VtxIdxIter}}
68 | \index{VtxIdxIter@{VtxIdxIter}!graphsim.h@{graphsim.h}}
69 | \subsubsection{\setlength{\rightskip}{0pt plus 5cm}typedef hash\_\-set$<${\bf Vertex\-Index}$>$::iterator {\bf Vtx\-Idx\-Iter}}\label{graphsim_8h_a3}
70 |
71 |
72 | Another iterator, this one for the adjacency lists Qubit\-Vertex::neigbors, and subsets. \index{graphsim.h@{graphsim.h}!VtxIdxIterConst@{VtxIdxIterConst}}
73 | \index{VtxIdxIterConst@{VtxIdxIterConst}!graphsim.h@{graphsim.h}}
74 | \subsubsection{\setlength{\rightskip}{0pt plus 5cm}typedef hash\_\-set$<${\bf Vertex\-Index}$>$::const\_\-iterator {\bf Vtx\-Idx\-Iter\-Const}}\label{graphsim_8h_a5}
75 |
76 |
77 | A constant version of Vtx\-Idx\-Iter
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | # Makefile for graphsim
2 |
3 | # This make file defines the following targets:
4 | # gs: The graphsim C++ library (as simple object file to link against)
5 | # and a small test program called gstest
6 | # pywrapper: Python bindings to graphsim (needs SWIG)
7 | # doc: documentation for use with C++ (needs Doxygen)
8 | # docpy: documentation for use with Python (needs Pydoc)
9 | # all: all of the above
10 | # chpcomp: compile Aaronson's CHP program to compare with this. Only for debugging
11 | # Needs subdirectory 'CHP'.
12 | # clean: Delete all generated files
13 |
14 | # Set these variables to 'yes' or 'no' to switch on or off debug information,
15 | # profile inpormation, and optimization
16 | DEBUG=yes
17 | PROFILE=no
18 | OPTIMIZE=yes
19 |
20 | # SWIG is a tool to generate bindings to the C++ library for script languages
21 | # (here: Python). Enter here the path to the SWIG binary. If you do not have
22 | # SWIG and do not need Python bindings, leave it empty and build only the target
23 | # 'gs', not 'all'
24 | SWIG=/usr/bin/swig
25 |
26 | # Mathlink is a part of Mathematica. It is used here to compare the computation of
27 | # graphsim with Scott Aaronson's CHP program. If you do not want to do debugging
28 | # or checking, you do not need this. Put it to 'no'.
29 | WITH_MATHLINK=no
30 | #MATHLINK=/opt/local/cluster/Mathematica/5.0/AddOns/MathLink/DeveloperKit/Linux/CompilerAdditions/
31 |
32 | # The following compiler flags are for GNU C/C++. if you have another compiler
33 | # you might have to change them
34 | CXX=g++
35 | CC=gcc
36 |
37 | CFLAGS=-Wall -fPIC
38 | NOLINK=-c
39 | ifeq (${DEBUG}, yes)
40 | CFLAGS += -g
41 | endif
42 | ifeq (${PROFILE}, yes)
43 | CFLAGS += -pg
44 | endif
45 | ifeq (${OPTIMIZE}, yes)
46 | CFLAGS += -O3
47 | endif
48 |
49 | # Doxygen binary. (Leave empty if you do not have Doxygen.)
50 | DOXYGEN=
51 |
52 | # End of user configurable settings.
53 |
54 | # This is for MathLink:
55 | MLLIB=
56 | MLINC=
57 | ifeq (${WITH_MATHLINK}, yes)
58 | CFLAGS += -DWITH_MATHLINK
59 | MLLIB = ${MATHLINK}/libML.a
60 | MLINC = -I${MATHLINK}
61 | endif
62 |
63 |
64 |
65 | all: gs pywrapper doc docpy
66 |
67 | gs: graphsim.o gstest
68 |
69 | pywrapper: graphsim.py _graphsim.so
70 |
71 | doc: doc/timestamp.dummy
72 |
73 | docpy: doc/graphsim_py.html
74 |
75 | chpcomp: chp.py _chp.so
76 |
77 | DELFILES=*.o _*.so gstest *_wrap.* graphsim.py \
78 | graphsim.html chp.py chp.html *.pyc core.*
79 | clean:
80 | rm -f ${DELFILES} CHP/${DELFILES}
81 | cd doc && rm -rf *
82 |
83 | # Now the details:
84 |
85 | gstest: graphsim.o loccliff.o stabilizer.o gstest.cpp
86 | ${CXX} ${CFLAGS} -o gstest gstest.cpp graphsim.o loccliff.o stabilizer.o ${MLLIB}
87 |
88 | graphsim.o: graphsim.cpp graphsim.h cphase.tbl loccliff.h stabilizer.h
89 | ${CXX} ${CFLAGS} ${NOLINK} graphsim.cpp
90 |
91 | loccliff.o: loccliff.cpp loccliff.h
92 | ${CXX} ${CFLAGS} ${NOLINK} loccliff.cpp
93 |
94 | stabilizer.o: stabilizer.cpp stabilizer.h graphsim.h loccliff.h
95 | ${CXX} ${CFLAGS} ${NOLINK} stabilizer.cpp ${MLINC}
96 |
97 | graphsim_wrap.cxx: graphsim.h loccliff.h
98 | ${SWIG} -python ${NOLINK}++ -globals consts graphsim.h
99 |
100 | _graphsim.so: graphsim.o graphsim_wrap.o loccliff.o stabilizer.o
101 | ${CXX} ${CFLAGS} -shared graphsim.o graphsim_wrap.o loccliff.o \
102 | stabilizer.o ${MLLIB} -o _graphsim.so
103 |
104 | graphsim_wrap.o: graphsim_wrap.cxx
105 | ${CXX} ${CFLAGS} ${NOLINK} graphsim_wrap.cxx -I/usr/include/python2.7/
106 |
107 | loccliff.h: multtbl.tbl
108 |
109 | graphsim.py: _graphsim.so
110 |
111 | doc/graphsim_py.html: graphsim.py
112 | pydoc -w ./graphsim.py
113 | mv graphsim.html doc/graphsim_py.html
114 |
115 | doc/chp.html: chp.py
116 | pydoc -w CHP/chp.py
117 | mv chp.html doc/chp_py.html
118 |
119 | doc/timestamp.dummy: graphsim.h loccliff.h stabilizer.h
120 | touch doc/timestamp.dummy
121 | ${DOXYGEN}
122 |
123 | chp.py: _chp.so
124 |
125 | chp_wrap.o: CHP/chp_wrap.c
126 | ${CC} ${CFLAGS} ${NOLINK} CHP/chp_wrap.c -I/usr/include/python2.7/
127 |
128 | chp_wrap.c: CHP/chp.i CHP/chp.h
129 | ${SWIG} -python CHP/chp.i
130 |
131 | chp.o: CHP/chp.c
132 | ${CC} ${CFLAGS} ${NOLINK} CHP/chp.c
133 |
134 | chp.py _chp.so: chp.o chp_wrap.o
135 | ${CC} ${CFLAGS} -shared chp.o chp_wrap.o -o _chp.so
136 |
--------------------------------------------------------------------------------
/Makefile.MacOSX:
--------------------------------------------------------------------------------
1 | # Makefile for graphsim
2 |
3 | # This make file defines the following targets:
4 | # graphsim: The graphsim C++ library (as simple object file to link against)
5 | # and a small test program called gstest
6 | # pywrapper: Python bindings to graphsim (needs SWIG)
7 | # doc: documentation for use with C++ (needs Doxygen)
8 | # docpy: documentation for use with Python (needs Pydoc)
9 | # all: all of the above
10 | # chpcomp: compile Aaronson's CHP program to compare with this. Only for debugging
11 | # Needs subdirectory 'CHP'.
12 | # clean: Delete all generated files
13 |
14 | # Stuff for MacOSX
15 | PYTHON=/System/Library/Frameworks/Python.framework/Versions/2.3
16 |
17 | # Set these variables to 'yes' or 'no' to switch on or off debug information,
18 | # profile inpormation, and optimization
19 | DEBUG=yes
20 | PROFILE=no
21 | OPTIMIZE=yes
22 |
23 | # SWIG is a tool to generate bindings to the C++ library for script languages
24 | # (here: Python). Enter here the path to the SWIG binary. If you do not have
25 | # SWIG and do not need Python bindings, leave it empty and build only the target
26 | # 'graphsim', not 'all'
27 | SWIG=/usr/local/bin/swig
28 |
29 | # Mathlink is a part of Mathematica. It is used here to compare the computation of
30 | # graphsim with Scott Aaronson's CHP program. If you do not want to do debugging
31 | # or checking, you do not need this. Put it to 'no'.
32 | WITH_MATHLINK=no
33 | MATHLINK=/opt/local/cluster/Mathematica/5.0/AddOns/MathLink/DeveloperKit/Linux/CompilerAdditions/
34 |
35 | # The following compiler flags are for GNU C/C++. if you have another compiler
36 | # you might have to change them
37 | CXX=g++
38 | CC=gcc
39 |
40 | CFLAGS=-W
41 | NOLINK=-c
42 | ifeq (${DEBUG}, yes)
43 | CFLAGS += -g
44 | endif
45 | ifeq (${PROFILE}, yes)
46 | CFLAGS += -pg
47 | endif
48 | ifeq (${OPTIMIZE}, yes)
49 | CFLAGS += -O3
50 | endif
51 |
52 | # Doxygen binary. (Leave empty if you do not have Doxygen.)
53 | DOXYGEN=
54 |
55 | # End of user configurable settings.
56 |
57 | # This is for MathLink:
58 | MLLIB=
59 | MLINC=
60 | ifeq (${WITH_MATHLINK}, yes)
61 | CFLAGS += -DWITH_MATHLINK
62 | MLLIB = ${MATHLINK}/libML.a
63 | MLINC = -I${MATHLINK}
64 | endif
65 |
66 |
67 | all: gs pywrapper doc docpy
68 |
69 | gs: graphsim.o gstest
70 |
71 | pywrapper: graphsim.py _graphsim.so
72 |
73 | doc: doc/timestamp.dummy
74 |
75 | docpy: doc/graphsim_py.html
76 |
77 | chpcomp: chp.py _chp.so
78 |
79 | DELFILES=*.o _*.so gstest *_wrap.* graphsim.py \
80 | graphsim.html chp.py chp.html *.pyc core.*
81 | clean:
82 | rm -f ${DELFILES} CHP/${DELFILES}
83 | cd doc && rm -rf *
84 |
85 | # Now the details:
86 |
87 | gstest: graphsim.o loccliff.o stabilizer.o gstest.cpp
88 | ${CXX} ${CFLAGS} -o gstest gstest.cpp graphsim.o loccliff.o stabilizer.o ${MLLIB}
89 |
90 | graphsim.o: graphsim.cpp graphsim.h cphase.tbl loccliff.h stabilizer.h
91 | ${CXX} ${CFLAGS} ${NOLINK} graphsim.cpp
92 |
93 | loccliff.o: loccliff.cpp loccliff.h
94 | ${CXX} ${CFLAGS} ${NOLINK} loccliff.cpp
95 |
96 | stabilizer.o: stabilizer.cpp stabilizer.h graphsim.h loccliff.h
97 | ${CXX} ${CFLAGS} ${NOLINK} stabilizer.cpp ${MLINC}
98 |
99 | graphsim_wrap.cxx: graphsim.h loccliff.h
100 | ${SWIG} -python ${NOLINK}++ -globals consts graphsim.h
101 |
102 | _graphsim.so: graphsim.o graphsim_wrap.o loccliff.o stabilizer.o
103 | ${CXX} ${CFLAGS} -framework Python -bundle -bundle_loader ${PYTHON}/bin/python graphsim.o graphsim_wrap.o loccliff.o \
104 | stabilizer.o ${MLLIB} -o _graphsim.so
105 |
106 | graphsim_wrap.o: graphsim_wrap.cxx
107 | ${CXX} ${CFLAGS} ${NOLINK} -fPIC graphsim_wrap.cxx -I${PYTHON}/Headers/
108 |
109 | loccliff.h: multtbl.tbl
110 |
111 | graphsim.py: _graphsim.so
112 |
113 | doc/graphsim_py.html: graphsim.py
114 | pydoc -w ./graphsim.py
115 | mv graphsim.html doc/graphsim_py.html
116 |
117 | doc/chp.html: chp.py
118 | pydoc -w CHP/chp.py
119 | mv chp.html doc/chp_py.html
120 |
121 | doc/timestamp.dummy: graphsim.h loccliff.h stabilizer.h
122 | touch doc/timestamp.dummy
123 | ${DOXYGEN}
124 |
125 | chp.py: _chp.so
126 |
127 | chp_wrap.o: CHP/chp_wrap.c
128 | ${CC} ${CFLAGS} ${NOLINK} -fPIC CHP/chp_wrap.c -I${PYTHON}/Headers
129 |
130 | chp_wrap.c: CHP/chp.i CHP/chp.h
131 | ${SWIG} -python CHP/chp.i
132 |
133 | chp.o: CHP/chp.c
134 | ${CC} ${CFLAGS} ${NOLINK} CHP/chp.c
135 |
136 | chp.py _chp.so: chp.o chp_wrap.o
137 | ${CC} ${CFLAGS} -framework Python -bundle -bundle_loader ${PYTHON}/bin/python chp.o chp_wrap.o -o _chp.so
138 |
--------------------------------------------------------------------------------
/doc/xml/structQubitVertex.xml:
--------------------------------------------------------------------------------
1 |
2 | | bitflip(VertexIndex v) | GraphRegister | [inline] |
| cnot(VertexIndex vc, VertexIndex vt) | GraphRegister | |
| cphase(VertexIndex v1, VertexIndex v2) | GraphRegister | |
| get_full_stabilizer(void) const | GraphRegister | |
| GraphRegister(VertexIndex numQubits, int randomize=-1) | GraphRegister | |
| GraphRegister(GraphRegister &gr) | GraphRegister | |
| hadamard(VertexIndex v) | GraphRegister | [inline] |
| invert_neighborhood(VertexIndex v) | GraphRegister | |
| local_op(VertexIndex v, LocCliffOp o) | GraphRegister | [inline] |
| measure(VertexIndex v, LocCliffOp basis=lco_Z, bool *determined=NULL, int force=-1) | GraphRegister | |
| phaseflip(VertexIndex v) | GraphRegister | [inline] |
| phaserot(VertexIndex v) | GraphRegister | [inline] |
| print_adj_list(ostream &os=cout) const | GraphRegister | |
| print_adj_list_line(ostream &os, VertexIndex i) const | GraphRegister | |
| print_stabilizer(ostream &os=cout) const | GraphRegister | |
| vertices | GraphRegister | |
| ~GraphRegister() (defined in GraphRegister) | GraphRegister | [inline] |
29 | 1.3.4
30 |
31 |
32 |
--------------------------------------------------------------------------------
/doc/html/namespaceloccliff__tables.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | 11 |
Variables | |
| const unsigned short | meas_conj_tbl [3][num_LocCliffOps] |
| 17 | const unsigned short | lco_mult_tbl [num_LocCliffOps][num_LocCliffOps] |
| const short | adj_tbl [24] |
| const short | phase_tbl [4][4] |
27 |
30 |
|
35 |
| 40 | 41 | | 42 |
43 |
44 | 45 | Initial value:
46 | { 0, 1, 2, 3,
47 | 4, 6, 5, 7,
48 | 8, 11, 10, 9,
49 | 12, 13, 15, 14,
50 | 20, 22, 23, 21,
51 | 16, 19, 17, 18}
52 | |
53 |
56 |
59 |
|
64 |
| 69 | 70 | | 71 |
72 |
73 | 74 | Initial value:
75 | {{1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3},
76 | {2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1},
77 | {3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2}}
78 | |
79 |
82 |
85 |
|
90 |
| 95 | 96 | | 97 |
98 |
99 | 100 | Initial value:
101 | {{0, 0, 0, 0},
102 | {0, 0, 1, 3},
103 | {0, 3, 0, 1},
104 | {0, 1, 3, 0}}
105 | |
106 |
111 | 1.3.4
112 |
113 |
114 |
--------------------------------------------------------------------------------
/doc/xml/structRightPhase.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 | #include <stabilizer.h>
12 |
13 | List of all members.
Public Member Functions | |
| 17 | | Stabilizer (const VertexIndex numQubits_) |
| 20 | | Stabilizer (const GraphRegister &gr, const hash_set< VertexIndex > &qubits) |
| 23 | | Stabilizer (QState *qs) |
| 26 | void | add_row (unsigned target, unsigned addend) |
| 29 | void | conjugate (unsigned row, unsigned col, const LocCliffOp trans) |
| 32 | void | conjugate_column (unsigned col, const LocCliffOp trans) |
| 35 | void | print (ostream &os=cout) const |
| 38 | bool | compare (const Stabilizer &diag) |
Public Attributes | |
| 42 | VertexIndex | numQubits |
| 45 | vector< vector< LocCliffOp > > | paulis |
| 48 | vector< RightPhase > | rowsigns |
| 51 | vector< VertexIndex > | vtxidx |
57 |
62 | 1.3.4
63 |
64 |
65 |
--------------------------------------------------------------------------------
/doc/html/structQubitVertex.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | #include <graphsim.h>
9 | 10 | List of all members.
Public Member Functions | |
| QubitVertex (void) | |
Public Attributes | |
| LocCliffOp | byprod |
| hash_set< VertexIndex > | neighbors |
24 |
26 |
29 |
|
41 |
| 46 | 47 | | 48 |
49 |
50 | 51 | Upon construction, a qubit vertex is initialised with the Hadamard operation as VOp, and with wmpty neighbor list. This makes it represent a |0>. |
52 |
56 |
59 |
|
64 |
| 69 | 70 | | 71 |
72 |
73 | 74 | byprod is the vertex operator (VOp) associated with the qubit (the name stems from the term 'byproduct operator' used for the similar concept in the one-way quantum computer. |
75 |
78 |
81 |
|
86 |
| 91 | 92 | | 93 |
94 |
95 | 96 | neigbors is the adjacency list for this vertex |
97 |
104 | 1.3.4
105 |
106 |
107 |
--------------------------------------------------------------------------------
/doc/html/doxygen.css:
--------------------------------------------------------------------------------
1 | H1 {
2 | text-align: center;
3 | font-family: Arial, Helvetica, sans-serif;
4 | }
5 | H2 {
6 | font-family: Geneva, Arial, Helvetica, sans-serif;
7 | }
8 | CAPTION { font-weight: bold }
9 | DIV.qindex { width: 100%;
10 | background-color: #eeeeff;
11 | border: 4px solid #eeeeff;
12 | text-align: center;
13 | margin-bottom: 2px
14 | }
15 | A.qindex { text-decoration: none; font-weight: bold; color: #0000ee }
16 | A.qindex:visited { text-decoration: none; font-weight: bold; color: #0000ee }
17 | A.qindex:hover { text-decoration: none; background-color: #ddddff }
18 | A.qindexHL { text-decoration: none; font-weight: bold;
19 | background-color: #6666cc;
20 | color: #ffffff
21 | }
22 | A.qindexHL:hover { text-decoration: none; background-color: #6666cc; color: #ffffff }
23 | A.qindexHL:visited { text-decoration: none; background-color: #6666cc; color: #ffffff }
24 | A.el { text-decoration: none; font-weight: bold }
25 | A.elRef { font-weight: bold }
26 | A.code { text-decoration: none; font-weight: normal; color: #4444ee }
27 | A.codeRef { font-weight: normal; color: #4444ee }
28 | A:hover { text-decoration: none; background-color: #f2f2ff }
29 | DL.el { margin-left: -1cm }
30 | DIV.fragment {
31 | width: 98%;
32 | border: 1px solid #CCCCCC;
33 | background-color: #f5f5f5;
34 | padding-left: 4px;
35 | margin: 4px;
36 | }
37 | DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px }
38 | TD.md { background-color: #f2f2ff; font-weight: bold; }
39 | TD.mdname1 { background-color: #f2f2ff; font-weight: bold; color: #602020; }
40 | TD.mdname { background-color: #f2f2ff; font-weight: bold; color: #602020; width: 600px; }
41 | DIV.groupHeader { margin-left: 16px; margin-top: 12px; margin-bottom: 6px; font-weight: bold }
42 | DIV.groupText { margin-left: 16px; font-style: italic; font-size: smaller }
43 | BODY {
44 | background: white;
45 | color: black;
46 | margin-right: 20px;
47 | margin-left: 20px;
48 | }
49 | TD.indexkey {
50 | background-color: #eeeeff;
51 | font-weight: bold;
52 | padding-right : 10px;
53 | padding-top : 2px;
54 | padding-left : 10px;
55 | padding-bottom : 2px;
56 | margin-left : 0px;
57 | margin-right : 0px;
58 | margin-top : 2px;
59 | margin-bottom : 2px
60 | }
61 | TD.indexvalue {
62 | background-color: #eeeeff;
63 | font-style: italic;
64 | padding-right : 10px;
65 | padding-top : 2px;
66 | padding-left : 10px;
67 | padding-bottom : 2px;
68 | margin-left : 0px;
69 | margin-right : 0px;
70 | margin-top : 2px;
71 | margin-bottom : 2px
72 | }
73 | TR.memlist {
74 | background-color: #f0f0f0;
75 | }
76 | P.formulaDsp { text-align: center; }
77 | IMG.formulaDsp { }
78 | IMG.formulaInl { vertical-align: middle; }
79 | SPAN.keyword { color: #008000 }
80 | SPAN.keywordtype { color: #604020 }
81 | SPAN.keywordflow { color: #e08000 }
82 | SPAN.comment { color: #800000 }
83 | SPAN.preprocessor { color: #806020 }
84 | SPAN.stringliteral { color: #002080 }
85 | SPAN.charliteral { color: #008080 }
86 | .mdTable {
87 | border: 1px solid #868686;
88 | background-color: #f2f2ff;
89 | }
90 | .mdRow {
91 | padding: 8px 20px;
92 | }
93 | .mdescLeft {
94 | font-size: smaller;
95 | font-family: Arial, Helvetica, sans-serif;
96 | background-color: #FAFAFA;
97 | padding-left: 8px;
98 | border-top: 1px none #E0E0E0;
99 | border-right: 1px none #E0E0E0;
100 | border-bottom: 1px none #E0E0E0;
101 | border-left: 1px none #E0E0E0;
102 | margin: 0px;
103 | }
104 | .mdescRight {
105 | font-size: smaller;
106 | font-family: Arial, Helvetica, sans-serif;
107 | font-style: italic;
108 | background-color: #FAFAFA;
109 | padding-left: 4px;
110 | border-top: 1px none #E0E0E0;
111 | border-right: 1px none #E0E0E0;
112 | border-bottom: 1px none #E0E0E0;
113 | border-left: 1px none #E0E0E0;
114 | margin: 0px;
115 | padding-bottom: 0px;
116 | padding-right: 8px;
117 | }
118 | .memItemLeft {
119 | padding: 1px 0px 0px 8px;
120 | margin: 4px;
121 | border-top-width: 1px;
122 | border-right-width: 1px;
123 | border-bottom-width: 1px;
124 | border-left-width: 1px;
125 | border-top-style: solid;
126 | border-top-color: #E0E0E0;
127 | border-right-color: #E0E0E0;
128 | border-bottom-color: #E0E0E0;
129 | border-left-color: #E0E0E0;
130 | border-right-style: none;
131 | border-bottom-style: none;
132 | border-left-style: none;
133 | background-color: #FAFAFA;
134 | font-family: Geneva, Arial, Helvetica, sans-serif;
135 | font-size: 12px;
136 | }
137 | .memItemRight {
138 | padding: 1px 0px 0px 8px;
139 | margin: 4px;
140 | border-top-width: 1px;
141 | border-right-width: 1px;
142 | border-bottom-width: 1px;
143 | border-left-width: 1px;
144 | border-top-style: solid;
145 | border-top-color: #E0E0E0;
146 | border-right-color: #E0E0E0;
147 | border-bottom-color: #E0E0E0;
148 | border-left-color: #E0E0E0;
149 | border-right-style: none;
150 | border-bottom-style: none;
151 | border-left-style: none;
152 | background-color: #FAFAFA;
153 | font-family: Geneva, Arial, Helvetica, sans-serif;
154 | font-size: 13px;
155 | }
156 | .search { color: #0000ee;
157 | font-weight: bold;
158 | }
159 | FORM.search {
160 | margin-bottom: 0px;
161 | margin-top: 0px;
162 | }
163 | INPUT.search { font-size: 75%;
164 | color: #000080;
165 | font-weight: normal;
166 | background-color: #eeeeff;
167 | }
168 | TD.tiny { font-size: 75%;
169 | }
170 |
--------------------------------------------------------------------------------
/loccliff.cpp:
--------------------------------------------------------------------------------
1 | // loccliff.cpp
2 |
3 | // version v0.10, of 2004-10-28
4 |
5 | // Copyright (C) 2004 Simon Anders 00001 // stabilizer.h 9 | 00002 10 | 00006 #ifndef STABILIZER_H 11 | 00007 #define STABILIZER_H 12 | 00008 13 | 00009 #include <iostream> 14 | 00010 #include <vector> 15 | 00011 #include <cassert> 16 | 00012 #include "loccliff.h" 17 | 00013 18 | 00014 #include <ext/hash_set> 19 | 00015 #ifndef SWIG 20 | 00016 using __gnu_cxx::hash_set; 21 | 00017 #endif 22 | 00018 // See note at top of file graphsim.h in case of problems compiling 23 | 00019 // the preceding lines. 24 | 00020 25 | 00021 26 | 00022 #ifdef SWIG 27 | 00023 struct QState; 28 | 00024 #else 29 | 00025 extern "C" { 30 | 00026 // The following struct declaration is quoted in verbatim from Scott 31 | 00027 // Aaronson's CHP program. (Scott, I hope, you don't mind.) It is used 32 | 00028 // here to implement the functionality of comparing a stabilizer state 33 | 00029 // in CHP with a state in graphsim. This is used to compare the action 34 | 00030 // of the two programs to ensure correctness. 35 | 00031 struct QState 36 | 00032 { 37 | 00033 long n; // # of qubits 38 | 00034 unsigned long **x; // (2n+1)*n matrix for stabilizer/destabilizer x bits (there's one "scratch row" at 39 | 00035 unsigned long **z; // (2n+1)*n matrix for z bits the bottom) 40 | 00036 int *r; // Phase bits: 0 for +1, 1 for i, 2 for -1, 3 for -i. Normally either 0 or 2. 41 | 00037 unsigned long pw[32]; // pw[i] = 2^i 42 | 00038 long over32; // floor(n/8)+1 43 | 00039 }; 44 | 00040 } 45 | 00041 #endif //SWIG 46 | 00042 47 | 00043 //forward declarations, definition in graphsim.h: 48 | 00044 49 | 00045 typedef unsigned long VertexIndex; 50 | 00046 struct QubitVertex; 51 | 00047 class GraphRegister; 52 | 00048 53 | 00050 /* This class is used at the moment only by GraphRegister::print_stabilizer and for 54 | 00051 the compare method (when comparing with CHP). */ 55 | 00052 struct Stabilizer { 56 | 00053 VertexIndex numQubits; 57 | 00054 vector<vector<LocCliffOp> > paulis; 58 | 00055 vector<RightPhase> rowsigns; 59 | 00056 vector<VertexIndex> vtxidx; 60 | 00057 Stabilizer (const VertexIndex numQubits_); 61 | 00058 Stabilizer (const GraphRegister& gr, const hash_set<VertexIndex>& qubits); 62 | 00059 Stabilizer (QState * qs); 63 | 00060 void add_row (unsigned target, unsigned addend); 64 | 00061 void conjugate (unsigned row, unsigned col, const LocCliffOp trans); 65 | 00062 void conjugate_column (unsigned col, const LocCliffOp trans); 66 | 00063 void print (ostream &os = cout) const; 67 | 00064 bool compare (const Stabilizer &diag); 68 | 00065 }; 69 | 00066 70 | 00067 #endif //STABILIZER_H 71 |
74 | 1.3.4
75 |
76 |
77 |
--------------------------------------------------------------------------------
/graphsim.h:
--------------------------------------------------------------------------------
1 | // graphsim.h
2 |
3 | /*!\mainpage
4 | This is 'graphsim', a simulator for stabilizer quantum cuircuits using the
5 | graph state formalism.
6 |
7 | graphsim version 0.10, dated 2005-Jan-27
8 |
9 | (c) Simon Anders (sanders@fs.tum.de), University of Innsbruck
10 |
11 | See the article
12 |
13 | S. Anders, H. J. Briegel:
14 | Fast simulation of Stabilizer Circuits using a Graph States Formalism
15 | quant-ph/0504117
16 |
17 | for a description of this software.
18 |
19 | ----
20 |
21 | // This file is free software; you can redistribute it and/or modify
22 | // it under the terms of the GNU General Public License as published by
23 | // the Free Software Foundation; either version 2, or (at your option)
24 | // any later version.
25 |
26 | // This file is distributed in the hope that it will be useful,
27 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
28 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 | // GNU General Public License for more details.
30 |
31 | // You should have received a copy of the GNU General Public License
32 | // along with this file; see the file COPYING. If not, browse to
33 | // http://www.fsf.org/licenses/gpl.html
34 |
35 | */
36 |
37 | /*!\file
38 | This header file defines the main interface of graphsim.
39 |
40 | (c) Simon Anders, University of Innsbruck, 2005
41 | released under GPL.
42 |
43 | Note: If you have trouble compiling this, please note:
44 | This file uses the "hash_set" template, which is an extension
45 | to the Standard C++ Library and the Standard Template Library,
46 | specified by SGI. Most C++ compilers have this template.
47 | For GNU C++, the header file #include <iostream>#include <stdlib.h>#include <vector>#include <cassert>#include "loccliff.h"#include "stabilizer.h"16 | Go to the source code of this file.
Namespaces | |
| namespace | std |
Classes | |
| struct | ConnectionInfo |
| class | GraphRegister |
| A quantum register. More... | |
| struct | QubitVertex |
Defines | |
| 31 | #define | DBGOUT(a) |
Typedefs | |
| typedef unsigned long | VertexIndex |
| typedef vector< QubitVertex 37 | >::iterator | VertexIter |
| typedef hash_set< VertexIndex 40 | >::iterator | VtxIdxIter |
| typedef vector< QubitVertex 43 | >::const_iterator | VertexIterConst |
| typedef hash_set< VertexIndex 46 | >::const_iterator | VtxIdxIterConst |
51 | (c) Simon Anders, University of Innsbruck, 2005 released under GPL.
52 | Note: If you have trouble compiling this, please note: This file uses the "hash_set" template, which is an extension to the Standard C++ Library and the Standard Template Library, specified by SGI. Most C++ compilers have this template. For GNU C++, the header file <ext/hash_set> hasa to be included and hash_set has to be prefixed with namespace __gnu_cxx. If you use another compiler, you might have to change the include file and the namespace identifier.
54 |
57 |
|
62 |
| 67 | 68 | | 69 |
70 |
71 | 72 | All vertices in a graph state are numbered beginning with 0. To specify auch an index, the type VertexIndex (which is just unsigned long) is always used |
73 |
76 |
79 |
|
84 |
| 89 | 90 | | 91 |
92 |
93 | 94 | As we often iterate over sublists of GraphRegister::vertices, this iterator typedef is a handy abbreviation. |
95 |
98 |
101 |
|
106 |
| 111 | 112 | | 113 |
114 |
115 | 116 | A constant version of VertexIter |
117 |
120 |
123 |
|
128 |
| 133 | 134 | | 135 |
136 |
137 | 138 | Another iterator, this one for the adjacency lists QubitVertex::neigbors, and subsets. |
139 |
142 |
145 |
|
150 |
| 155 | 156 | | 157 |
158 |
159 | 160 | A constant version of VtxIdxIter |
161 |
166 | 1.3.4
167 |
168 |
169 |
--------------------------------------------------------------------------------
/doc/html/structLocCliffOp.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 | #include <loccliff.h>
12 |
13 | List of all members.
Public Member Functions | |
| 17 | | LocCliffOp (unsigned short int op_) |
| constructor, takes an integer in 0..23. | |
| LocCliffOp (unsigned short int signsymb, unsigned short int permsymb) | |
| constructor, takes a sign symbol in 0..3 (for I, X, Y, Z) and a | |
| 24 | string | get_name (void) const |
| returns something like e.g. "YC" for Hadamard=Y^C | |
| RightPhase | conjugate (const LocCliffOp trans) |
| replaces op by trans * op * trans^dagger and returns a phase, | |
| 31 | LocCliffOp | herm_adjoint (void) const |
| returns the Hermitian adjoint of op | |
| 35 | bool | isXY (void) const |
| returns True if op is XA or YA. | |
| 39 | bool | is_diagonal (void) const |
| returns True if op is an operator diagonal in the computational basis | |
| 43 | RightMatrix | get_matrix (void) const |
Static Public Member Functions | |
| 47 | RightPhase | mult_phase (LocCliffOp op1, LocCliffOp op2) |
| returns the phase of the multiplication of op1 * op2 | |
Public Attributes | |
| unsigned short | op |
57 |
59 |
62 |
|
83 | ||||||||||||
| 88 | 89 | | 90 |
91 |
92 | 93 | constructor, takes a sign symbol in 0..3 (for I, X, Y, Z) and a 94 | 95 | permutation symbol 0..5 (for A, B, ..., F) |
96 |
100 |
103 |
|
115 |
| 120 | 121 | | 122 |
123 |
124 | 125 | replaces op by trans * op * trans^dagger and returns a phase, 126 | 127 | either +1 or -1 (as RightPhase(0) or RightPhase(2)) |
128 |
132 |
135 |
|
140 |
| 145 | 146 | | 147 |
148 |
149 | 150 | The field 'op' identifies the operator. 0 is identity I, 1 is Pauli X, 2 is Pauli Y, 3 is Pauli Z, 4 is I^B, 5 is I^C etc. |
151 |
158 | 1.3.4
159 |
160 |
161 |
--------------------------------------------------------------------------------