1 /* objcode.h: Object code declarations and definitions
2 
3    Copyright 2003 Bjoern Butscher, Hendrik Weimer
4 
5    This file is part of libquantum
6 
7    libquantum is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published
9    by the Free Software Foundation; either version 3 of the License,
10    or (at your option) any later version.
11 
12    libquantum is distributed in the hope that it will be useful, but
13    WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15    General Public License for more details.
16 
17    You should have received a copy of the GNU General Public License
18    along with libquantum; if not, write to the Free Software
19    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
20    MA 02110-1301, USA
21 
22 */
23 
24 #ifndef __OBJCODE_H
25 
26 #define __OBJCODE_H
27 
28 #include "config.h"
29 #include "qureg.h"
30 
31 #define OBJCODE_PAGE 65536
32 #define OBJBUF_SIZE 80
33 
34 enum {
35   INIT        = 0x00,
36   CNOT        = 0x01,
37   TOFFOLI     = 0x02,
38   SIGMA_X     = 0x03,
39   SIGMA_Y     = 0x04,
40   SIGMA_Z     = 0x05,
41   HADAMARD    = 0x06,
42   ROT_X       = 0x07,
43   ROT_Y       = 0x08,
44   ROT_Z       = 0x09,
45   PHASE_KICK  = 0x0A,
46   PHASE_SCALE = 0x0B,
47   COND_PHASE  = 0x0C,
48   CPHASE_KICK = 0x0D,
49   SWAPLEADS   = 0x0E,
50 
51   MEASURE     = 0x80,
52   BMEASURE    = 0x81,
53   BMEASURE_P  = 0x82,
54 
55   NOP         = 0xFF
56 };
57 
58 extern MAX_UNSIGNED quantum_char2mu(unsigned char *buf);
59 extern int quantum_char2int(unsigned char *buf);
60 extern double quantum_char2double(unsigned char *buf);
61 extern void quantum_objcode_start();
62 extern void quantum_objcode_stop();
63 extern int quantum_objcode_put(unsigned char operation, ...);
64 extern int quantum_objcode_write(char *file);
65 extern void quantum_objcode_file(char *file);
66 extern void quantum_objcode_exit(char *file);
67 extern void quantum_objcode_run(char *file, quantum_reg *reg);
68 
69 #endif
70