libqasm 0.6.5__cp312-cp312-macosx_10_10_universal2.whl → 0.6.6__cp312-cp312-macosx_10_10_universal2.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cqasm/v3x/__init__.py +6 -6
- cqasm/v3x/ast.py +139 -197
- cqasm/v3x/semantic.py +74 -65
- cqasm/v3x/types.py +306 -0
- {libQasm → libqasm}/__init__.py +1 -1
- libqasm/_libqasm.cpython-312-darwin.so +0 -0
- libqasm/libqasm.py +1082 -0
- {libqasm-0.6.5.dist-info → libqasm-0.6.6.dist-info}/METADATA +61 -27
- libqasm-0.6.6.dist-info/RECORD +16 -0
- libqasm-0.6.6.dist-info/top_level.txt +2 -0
- libQasm/_libQasm.cpython-312-darwin.so +0 -0
- libQasm/libQasm.py +0 -1082
- libqasm-0.6.5.dist-info/RECORD +0 -16
- libqasm-0.6.5.dist-info/top_level.txt +0 -2
- {libqasm-0.6.5.dist-info → libqasm-0.6.6.dist-info}/LICENSE.md +0 -0
- {libqasm-0.6.5.dist-info → libqasm-0.6.6.dist-info}/WHEEL +0 -0
@@ -1,7 +1,7 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: libqasm
|
3
|
-
Version: 0.6.
|
4
|
-
Summary:
|
3
|
+
Version: 0.6.6
|
4
|
+
Summary: libqasm Python Package
|
5
5
|
Home-page: https://github.com/QuTech-Delft/libqasm
|
6
6
|
Author: QuTech, TU Delft
|
7
7
|
Classifier: License :: OSI Approved :: Apache Software License
|
@@ -80,28 +80,34 @@ in case it cannot find the binary packages for the current configuration (platfo
|
|
80
80
|
|
81
81
|
### Build profiles
|
82
82
|
|
83
|
-
A group of predefined profiles is provided under the `conan/profiles` folder
|
84
|
-
They follow the `[tests
|
85
|
-
- `
|
86
|
-
- `
|
83
|
+
A group of predefined profiles is provided under the `conan/profiles` folder.<br/>
|
84
|
+
They follow the `[tests](-build_type)(-compiler)(-os)(-arch)[-shared]` naming convention:
|
85
|
+
- `tests`: if tests are being built.
|
86
|
+
- `build_type`: can be `debug` or `release`.
|
87
|
+
- `compiler`: `apple-clang`, `clang`, `gcc`, `msvc`.
|
88
|
+
- `os`: `emscripten`, `linux`, `macos`, `windows`.
|
89
|
+
- `arch`: `arm64`, `wasm`, `x64`.
|
90
|
+
- `shared`: if the library is being built in shared mode.
|
87
91
|
|
88
|
-
All the profiles set the C++ standard to 20
|
92
|
+
All the profiles set the C++ standard to 20.<br/>
|
93
|
+
All the `tests`, except for `linux-x64` profiles, enable Address Sanitizer.
|
89
94
|
|
90
95
|
### Build options
|
91
96
|
|
92
|
-
Profiles are a shorthand for command line options. The command above could be written as
|
97
|
+
Profiles are a shorthand for command line options. The command above could be written, similarly, as:
|
93
98
|
|
94
99
|
```
|
95
|
-
conan build . -s:
|
100
|
+
conan build . -s:a compiler.cppstd=20 -s:a libqasm/*:build_type=Debug -o libqasm/*:build_tests=True -o libqasm/*:asan_enabled=True -b missing
|
96
101
|
```
|
97
102
|
|
98
|
-
|
103
|
+
This is the list of options that could be specified either in a profile or in the command line:
|
99
104
|
|
100
105
|
- `libqasm/*:asan_enabled={True,False}`: enables Address Sanitizer.
|
101
|
-
- `libqasm/*:build_tests={True,False}`: builds tests or not.
|
102
106
|
- `libqasm/*:build_type={Debug,Release}`: builds in debug or release mode.
|
103
107
|
- `libqasm/*:shared={True,False}`: builds a shared object library instead of a static library, if applicable.
|
104
108
|
|
109
|
+
Tests are enabled by default. To disable them, use `-c tools.build:skip_test=True`.
|
110
|
+
|
105
111
|
## Install
|
106
112
|
|
107
113
|
### From Python
|
@@ -123,7 +129,7 @@ python3 -m pytest
|
|
123
129
|
The `CMakeLists.txt` file in the root directory includes install targets:
|
124
130
|
|
125
131
|
```
|
126
|
-
conan create --version 0.
|
132
|
+
conan create --version 0.6.6 . -pr:a=tests-debug -b missing
|
127
133
|
```
|
128
134
|
|
129
135
|
You can test if it works by doing:
|
@@ -137,30 +143,49 @@ ctest -C Debug --output-on-failure
|
|
137
143
|
|
138
144
|
### From Python
|
139
145
|
|
140
|
-
|
141
|
-
|
146
|
+
The `libqasm` module should provide access to the `V3xAnalyzer` API:
|
147
|
+
- `parse_file`,
|
148
|
+
- `parse_string`,
|
149
|
+
- `analyze_file`, and
|
150
|
+
- `analyzer_string`.
|
151
|
+
|
152
|
+
The `cqasm.v3x` module is also available for a more fine-grained use of the library.
|
153
|
+
|
154
|
+
```
|
155
|
+
import cqasm.v3x.ast
|
156
|
+
import cqasm.v3x.instruction
|
157
|
+
import cqasm.v3x.primitives
|
158
|
+
import cqasm.v3x.semantic
|
159
|
+
import cqasm.v3x.types
|
160
|
+
import cqasm.v3x.values
|
161
|
+
```
|
142
162
|
|
143
163
|
### From C++
|
144
164
|
|
145
|
-
|
165
|
+
`libqasm` can be requested as a Conan package from a `conanfile.py`.
|
166
|
+
|
167
|
+
```
|
168
|
+
def build_requirements(self):
|
169
|
+
self.tool_requires("libqasm/0.6.5")
|
170
|
+
def requirements(self):
|
171
|
+
self.requires("libqasm/0.6.5")
|
172
|
+
```
|
173
|
+
|
174
|
+
And then linked against from a `CMakeLists.txt`:
|
146
175
|
|
147
176
|
```
|
148
|
-
|
149
|
-
FetchContent_Declare(cqasm
|
150
|
-
GIT_REPOSITORY https://github.com/QuTech-Delft/libqasm.git
|
151
|
-
GIT_TAG "<a given cqasm git tag>"
|
152
|
-
)
|
153
|
-
FetchContent_MakeAvailable(cqasm)
|
154
|
-
target_include_directories(<your target> SYSTEM PRIVATE "${cqasm_SOURCE_DIR}/include")
|
155
|
-
target_link_libraries(<your target> PUBLIC cqasm)
|
177
|
+
target_link_libraries(<your target> PUBLIC libqasm::libqasm)
|
156
178
|
```
|
157
179
|
|
158
180
|
Note that the following dependency is required for `libqasm` to build:
|
159
181
|
|
160
182
|
* `Java JRE` >= 11
|
161
183
|
|
162
|
-
The
|
163
|
-
|
184
|
+
The header file `cqasm.hpp` should provide access to the following API:
|
185
|
+
- `cqasm::v3x::analyze_file`, and
|
186
|
+
- `cqasm::v3x::analyze_string`.
|
187
|
+
|
188
|
+
Again, other header files are available for a more fine-grained use of the library.
|
164
189
|
|
165
190
|
## Docker
|
166
191
|
|
@@ -170,7 +195,7 @@ This tests the library in a container with the bare minimum requirements for `li
|
|
170
195
|
docker build .
|
171
196
|
```
|
172
197
|
|
173
|
-
**Note for Windows users:** The above might fail on Windows to the autocrlf transformation that git does.
|
198
|
+
**Note for Windows users:** The above might fail on Windows due to the `autocrlf` transformation that git does.
|
174
199
|
If you are having trouble with this just create new clone of this repository using:
|
175
200
|
|
176
201
|
```
|
@@ -182,9 +207,18 @@ git clone --config core.autocrlf=input git@github.com:QuTech-Delft/libqasm.git
|
|
182
207
|
The generation of emscripten binaries has been tested as a cross-compilation from an ubuntu/x64 platform.
|
183
208
|
|
184
209
|
```
|
185
|
-
conan build . -pr=conan/profiles/emscripten -pr:b=conan/profiles/release -b missing
|
210
|
+
conan build . -pr=conan/profiles/release-clang-emscripten-wasm -pr:b=conan/profiles/release -b missing
|
186
211
|
```
|
187
212
|
|
188
213
|
The output of this build lives in `build/Release/emscripten`:
|
189
214
|
- `cqasm_emscripten.js`.
|
190
215
|
- `cqasm_emscripten.wasm`.
|
216
|
+
|
217
|
+
Note that `cqasm_emscripten.js` is an ES6 module. An example of how to use it would be:
|
218
|
+
|
219
|
+
```
|
220
|
+
cd build/Release/emscripten
|
221
|
+
mv cqasm_emscripten.js cqasm_emscripten.mjs
|
222
|
+
cd ../../../emscripten
|
223
|
+
deno run -A test_libqasm.ts
|
224
|
+
```
|
@@ -0,0 +1,16 @@
|
|
1
|
+
cqasm/__init__.py,sha256=MsSFjiLMLJZ7QhUPpVBWKiyDnCzryquRyr329NoCACI,2
|
2
|
+
cqasm/v3x/__init__.py,sha256=S2V6EAh1mNbDyNoA1tZfjZ-Pgykqry_LeA_KEhqTjZY,2785
|
3
|
+
cqasm/v3x/ast.py,sha256=Vng_gxnIBqbNrEa9ElHIUDLBWEEXQGCagddx6AnbgFc,409207
|
4
|
+
cqasm/v3x/instruction.py,sha256=AEOwKV2riafpyTiJvgq7azwOhyhhZfpKV12uWWJ5M2A,1177
|
5
|
+
cqasm/v3x/primitives.py,sha256=ESCsMHP1GeuKh2gHQSP0ha24Abp453U-I7JSGK9dZas,1664
|
6
|
+
cqasm/v3x/semantic.py,sha256=7JB7EU2QL6m4LZC8uPp-giGVRUa_RwKzlci1PA4LRIg,86312
|
7
|
+
cqasm/v3x/types.py,sha256=izXYdNmYvJUcRSZVLJ-blPnU2TmhOGR1Z3Rhtk8rTOQ,63328
|
8
|
+
cqasm/v3x/values.py,sha256=YY_41YQ7iU2te7FqtstGnQJd4W3CFH7LmkawSKh5e_A,61680
|
9
|
+
libqasm/__init__.py,sha256=liVJFi24VHbmUU-9lBA6hm-xPpF1DgzXMsZ0f1dqO3E,727
|
10
|
+
libqasm/_libqasm.cpython-312-darwin.so,sha256=GRLtdq-Yo2cA9q5JvOumBGUTI2BDWvUmj2y_a4lV1F8,4253096
|
11
|
+
libqasm/libqasm.py,sha256=io7NCBJdhdoguyRWGAWCKjc4fQnLL9Wngta4a9MXM9M,30595
|
12
|
+
libqasm-0.6.6.dist-info/LICENSE.md,sha256=duRlJgy46W8Cw_IQjOmud5xJUvgJkX6pkBmBJkoKi4I,566
|
13
|
+
libqasm-0.6.6.dist-info/METADATA,sha256=7v_psmJ26_kET6lU0_dLWtyG0HNzXZ21k9l1dEUmpDc,6551
|
14
|
+
libqasm-0.6.6.dist-info/WHEEL,sha256=bCe9NkCcZZhnfFYccFz_TeJCD_m2mB9psi4akKL7FvI,116
|
15
|
+
libqasm-0.6.6.dist-info/top_level.txt,sha256=iZ8PSLyg3lJwvSUCvWE8VCJGU-nmQY2YIrbMe7M7kLw,14
|
16
|
+
libqasm-0.6.6.dist-info/RECORD,,
|
Binary file
|