libqasm 0.6.6__cp310-cp310-win_amd64.whl → 0.6.8__cp310-cp310-win_amd64.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 +71 -22
- cqasm/v3x/ast.py +665 -377
- cqasm/v3x/primitives.py +5 -0
- cqasm/v3x/semantic.py +771 -25
- libqasm/_libqasm.cp310-win_amd64.pyd +0 -0
- libqasm/libqasm.py +8 -8
- libqasm-0.6.8.dist-info/METADATA +128 -0
- libqasm-0.6.8.dist-info/RECORD +16 -0
- {libqasm-0.6.6.dist-info → libqasm-0.6.8.dist-info}/WHEEL +1 -1
- libqasm-0.6.6.dist-info/METADATA +0 -224
- libqasm-0.6.6.dist-info/RECORD +0 -16
- {libqasm-0.6.6.dist-info → libqasm-0.6.8.dist-info}/LICENSE.md +0 -0
- {libqasm-0.6.6.dist-info → libqasm-0.6.8.dist-info}/top_level.txt +0 -0
cqasm/v3x/primitives.py
CHANGED
@@ -45,6 +45,11 @@ def serialize(typ, val):
|
|
45
45
|
def deserialize(typ, val):
|
46
46
|
if isinstance(typ, str):
|
47
47
|
return None
|
48
|
+
elif typ is Str and isinstance(val['x'], bytes):
|
49
|
+
# CBOR strings are bytes objects. The correct conversion to Str would be through a decoding.
|
50
|
+
# Str(b'qubit', 'utf-8') would generate the string "qubit". This is the same as b'qubit'.decode('utf-8')
|
51
|
+
# Whereas Str(b'qubit') would generate the string "b'qubit'"
|
52
|
+
return Str(val['x'], 'utf-8')
|
48
53
|
elif typ is Str:
|
49
54
|
return Str(val['x'])
|
50
55
|
elif typ is Bool:
|