cda-tum / mqt-qecc Goto Github PK
View Code? Open in Web Editor NEWMQT QECC - Tools for Quantum Error Correcting Codes
License: MIT License
MQT QECC - Tools for Quantum Error Correcting Codes
License: MIT License
mqt.qecc 1.3.1
20.04.1-Ubuntu
Python 3.10
No response
No response
When I follow the build instructions at https://qecc.readthedocs.io/en/latest/DevelopmentGuide.html errors occur:
Specifically when I type pip install --editable .[dev]
this error occurs (The project also doesn't install without using the editable mode):
error: subprocess-exited-with-error
Γ Building editable for mqt.qecc (pyproject.toml) did not run successfully.
β exit code: 1
β°β> [156 lines of output]
/tmp/pip-build-env-bcf33gnq/overlay/lib/python3.9/site-packages/setuptools/config/pyprojecttoml.py:66: _BetaConfiguration: Support for `[tool.setuptools]` in `pyproject.toml` is still *beta*.
config = read_configuration(filepath, True, ignore_option_errors, dist)
running editable_wheel
creating /tmp/pip-wheel-7cj88rx4/.tmp-kn816tck/mqt.qecc.egg-info
writing /tmp/pip-wheel-7cj88rx4/.tmp-kn816tck/mqt.qecc.egg-info/PKG-INFO
writing dependency_links to /tmp/pip-wheel-7cj88rx4/.tmp-kn816tck/mqt.qecc.egg-info/dependency_links.txt
writing entry points to /tmp/pip-wheel-7cj88rx4/.tmp-kn816tck/mqt.qecc.egg-info/entry_points.txt
writing requirements to /tmp/pip-wheel-7cj88rx4/.tmp-kn816tck/mqt.qecc.egg-info/requires.txt
writing top-level names to /tmp/pip-wheel-7cj88rx4/.tmp-kn816tck/mqt.qecc.egg-info/top_level.txt
writing manifest file '/tmp/pip-wheel-7cj88rx4/.tmp-kn816tck/mqt.qecc.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching '**/apps'
adding license file 'LICENSE'
writing manifest file '/tmp/pip-wheel-7cj88rx4/.tmp-kn816tck/mqt.qecc.egg-info/SOURCES.txt'
creating '/tmp/pip-wheel-7cj88rx4/.tmp-kn816tck/mqt.qecc-1.3.2.dev5+g97b9c9a.dist-info'
creating /tmp/pip-wheel-7cj88rx4/.tmp-kn816tck/mqt.qecc-1.3.2.dev5+g97b9c9a.dist-info/WHEEL
running build_py
running build_ext
-- The CXX compiler identification is GNU 9.4.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test HAS_MARCH_NATIVE
-- Performing Test HAS_MARCH_NATIVE - Success
-- Could NOT find GMP (missing: GMPXX_LIB GMPXX_INCLUDE_DIR GMP_INCLUDE_DIR GMP_LIB)
Did not find GMP. Using Boost multiprecision library instead.
-- Boost.Multiprecision: standalone mode ON
-- Using the single-header code from /home/pderks/Documents/phd/qecc/extern/qfr/extern/json/single_include/
-- pybind11 v2.11.0 dev1
-- Found PythonInterp: /home/pderks/Documents/phd/qecc/qecc_venv/bin/python3 (found suitable version "3.9.7", minimum required is "3.6")
-- Found PythonLibs: /home/pderks/anaconda3/lib/libpython3.9.so
-- The C compiler identification is GNU 9.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
CMake Error at /tmp/pip-build-env-bcf33gnq/overlay/lib/python3.9/site-packages/cmake/data/share/cmake-3.26/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find FLINT (missing: FLINT_LIBRARY FLINT_INCLUDE_DIR)
Call Stack (most recent call first):
/tmp/pip-build-env-bcf33gnq/overlay/lib/python3.9/site-packages/cmake/data/share/cmake-3.26/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
cmake/FindFLINT.cmake:83 (find_package_handle_standard_args)
src/CMakeLists.txt:32 (find_package)
-- Configuring incomplete, errors occurred!
Traceback (most recent call last):
File "/tmp/pip-build-env-bcf33gnq/overlay/lib/python3.9/site-packages/setuptools/command/editable_wheel.py", line 155, in run
self._create_wheel_file(bdist_wheel)
File "/tmp/pip-build-env-bcf33gnq/overlay/lib/python3.9/site-packages/setuptools/command/editable_wheel.py", line 344, in _create_wheel_file
files, mapping = self._run_build_commands(dist_name, unpacked, lib, tmp)
File "/tmp/pip-build-env-bcf33gnq/overlay/lib/python3.9/site-packages/setuptools/command/editable_wheel.py", line 267, in _run_build_commands
self._run_build_subcommands()
File "/tmp/pip-build-env-bcf33gnq/overlay/lib/python3.9/site-packages/setuptools/command/editable_wheel.py", line 294, in _run_build_subcommands
self.run_command(name)
File "/tmp/pip-build-env-bcf33gnq/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "/tmp/pip-build-env-bcf33gnq/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 1244, in run_command
super().run_command(command)
File "/tmp/pip-build-env-bcf33gnq/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/tmp/pip-build-env-bcf33gnq/overlay/lib/python3.9/site-packages/setuptools/command/build_ext.py", line 84, in run
_build_ext.run(self)
File "/tmp/pip-build-env-bcf33gnq/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 345, in run
self.build_extensions()
File "/tmp/pip-build-env-bcf33gnq/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 467, in build_extensions
self._build_extensions_serial()
File "/tmp/pip-build-env-bcf33gnq/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 493, in _build_extensions_serial
self.build_extension(ext)
File "<string>", line 94, in build_extension
File "/home/pderks/anaconda3/lib/python3.9/subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '/home/pderks/Documents/phd/qecc', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/tmp2h4mezoc.build-lib/mqt/qecc', '-DPYTHON_EXECUTABLE=/home/pderks/Documents/phd/qecc/qecc_venv/bin/python3', '-DQECC_VERSION_INFO=1.3.2.dev5+g97b9c9a', '-DCMAKE_BUILD_TYPE=Release', '-DBINDINGS=ON', '-GNinja']' returned non-zero exit status 1.
/tmp/pip-build-env-bcf33gnq/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py:988: _DebuggingTips: Problem in editable installation.
!!
********************************************************************************
An error happened while installing `mqt.qecc` in editable mode.
The following steps are recommended to help debug this problem:
- Try to install the project normally, without using the editable mode.
Does the error still persist?
(If it does, try fixing the problem before attempting the editable mode).
- If you are using binary extensions, make sure you have all OS-level
dependencies installed (e.g. compilers, toolchains, binary libraries, ...).
- Try the latest version of setuptools (maybe the error was already fixed).
- If you (or your project dependencies) are using any setuptools extension
or customization, make sure they support the editable mode.
After following the steps above, if the problem still persists and
you think this is related to how setuptools handles editable installations,
please submit a reproducible example
(see https://stackoverflow.com/help/minimal-reproducible-example) to:
https://github.com/pypa/setuptools/issues
See https://setuptools.pypa.io/en/latest/userguide/development_mode.html for details.
********************************************************************************
!!
cmd_obj.run()
Traceback (most recent call last):
File "/home/pderks/Documents/phd/qecc/qecc_venv/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
main()
File "/home/pderks/Documents/phd/qecc/qecc_venv/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/home/pderks/Documents/phd/qecc/qecc_venv/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 273, in build_editable
return hook(wheel_directory, config_settings, metadata_directory)
File "/tmp/pip-build-env-bcf33gnq/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 445, in build_editable
return self._build_with_temp_dir(
File "/tmp/pip-build-env-bcf33gnq/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 401, in _build_with_temp_dir
self.run_setup()
File "/tmp/pip-build-env-bcf33gnq/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 338, in run_setup
exec(code, locals())
File "<string>", line 102, in <module>
File "/tmp/pip-build-env-bcf33gnq/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 107, in setup
return distutils.core.setup(**attrs)
File "/tmp/pip-build-env-bcf33gnq/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 185, in setup
return run_commands(dist)
File "/tmp/pip-build-env-bcf33gnq/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
dist.run_commands()
File "/tmp/pip-build-env-bcf33gnq/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
self.run_command(cmd)
File "/tmp/pip-build-env-bcf33gnq/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 1244, in run_command
super().run_command(command)
File "/tmp/pip-build-env-bcf33gnq/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/tmp/pip-build-env-bcf33gnq/overlay/lib/python3.9/site-packages/setuptools/command/editable_wheel.py", line 155, in run
self._create_wheel_file(bdist_wheel)
File "/tmp/pip-build-env-bcf33gnq/overlay/lib/python3.9/site-packages/setuptools/command/editable_wheel.py", line 344, in _create_wheel_file
files, mapping = self._run_build_commands(dist_name, unpacked, lib, tmp)
File "/tmp/pip-build-env-bcf33gnq/overlay/lib/python3.9/site-packages/setuptools/command/editable_wheel.py", line 267, in _run_build_commands
self._run_build_subcommands()
File "/tmp/pip-build-env-bcf33gnq/overlay/lib/python3.9/site-packages/setuptools/command/editable_wheel.py", line 294, in _run_build_subcommands
self.run_command(name)
File "/tmp/pip-build-env-bcf33gnq/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "/tmp/pip-build-env-bcf33gnq/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 1244, in run_command
super().run_command(command)
File "/tmp/pip-build-env-bcf33gnq/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/tmp/pip-build-env-bcf33gnq/overlay/lib/python3.9/site-packages/setuptools/command/build_ext.py", line 84, in run
_build_ext.run(self)
File "/tmp/pip-build-env-bcf33gnq/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 345, in run
self.build_extensions()
File "/tmp/pip-build-env-bcf33gnq/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 467, in build_extensions
self._build_extensions_serial()
File "/tmp/pip-build-env-bcf33gnq/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 493, in _build_extensions_serial
self.build_extension(ext)
File "<string>", line 94, in build_extension
File "/home/pderks/anaconda3/lib/python3.9/subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '/home/pderks/Documents/phd/qecc', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/tmp2h4mezoc.build-lib/mqt/qecc', '-DPYTHON_EXECUTABLE=/home/pderks/Documents/phd/qecc/qecc_venv/bin/python3', '-DQECC_VERSION_INFO=1.3.2.dev5+g97b9c9a', '-DCMAKE_BUILD_TYPE=Release', '-DBINDINGS=ON', '-GNinja']' returned non-zero exit status 1.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building editable for mqt.qecc
Failed to build mqt.qecc
ERROR: Could not build wheels for mqt.qecc, which is required to install pyproject.toml-based projects```
### Expected behavior
I expected to be able to run `pip install --editable .[dev]`
### How to Reproduce
Follow steps 1-7 at [https://qecc.readthedocs.io/en/latest/DevelopmentGuide.html](url) and then run `pip install --editable .[dev]`
Currently, the Q18Surface code of the EccFramework is based on its referenced paper, but does not completely rely on its ideas.
After adding a description, it should be more clear which concepts are taken from the respective paper, and how the code is built up in detail.
mqt.qecc==0.0.2
Ubuntu 22.02
No response
No response
No response
currently the ecc framework tests seem to be broken due to a new Qiskit version. This was for now fixed by capping the qiskit version #93. Instead, the framework should be updated to work for current versions and the version cap should be removed accordingly.
No response
tests fail, e.g. see https://github.com/cda-tum/qecc/actions/runs/4408857033/jobs/7724404102?pr=85
As remarked in #74 (comment) python 3.11 should be supported.
Include py 3.11 in config files
Include https://github.com/charliermarsh/ruff for python linting as in mqt/qcec
see cda-tum/mqt-qcec#255 for a setup
CI builds can be quite slow and take up a considerable amount of time. ccache
, in particular https://github.com/hendrikmuhs/ccache-action allows to set up a consistent compiler cache for your GitHub CI workflows that speeds up compilation across runs.
Adopt ccache
for our CI builds. Should be as simple as
- name: Setup ccache
uses: hendrikmuhs/[email protected]
with:
key: '${{matrix.os}}-${{matrix.compiler}}-${{matrix.build_type}}'
variant: ccache
save: true
max-size: 10G
and passing -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache
to CMake.
Some slight modification might be necessary for Windows.
currently cc-cache does not work for python due to build technicalities.
Once this is resolved, cc-cache has to be adopted accordinlgy to work across the python workflow as well. This builds on #128
The error corrected circuit has incorrect output when measuring Z on all data qubits.
Therefore, the ECC protocol does not work.
Correct encoding resulting in correct logical qubit when measuring data qubits
from mqt import qecc
from qiskit import QuantumCircuit, Aer, execute, ClassicalRegister
from qiskit.compiler import transpile
file = "./minimalbeispielsource.qasm"
ecc = "Q7Steane"
ecc_frequency = 10
qc = QuantumCircuit(1)
qc.x(0)
qc.qasm(filename=file)
result = qecc.apply_ecc(file, ecc, ecc_frequency)
circ = QuantumCircuit.from_qasm_str(result["circ"])
cr = ClassicalRegister(1,'my_reg')
# measure encoded logical qubit by measuring logical Z = ZZZZZZZ
circ.add_register(cr)
for i in range(7):
circ.measure(circ.qubits[i],cr)
simulator = Aer.get_backend('qasm_simulator')
# Transpile the circuit for the simulator
transpiled_circuit = transpile(circ, simulator)
# Run the simulation
job = execute(transpiled_circuit, simulator, shots=1024, optimization_level=0) # You can adjust the number of shots as needed
result = job.result()
# Get the counts from the simulation results
counts = result.get_counts()
# get the measurement outcomes
states = [k for k, _ in counts.items()]
# get the logical measurement results for encoded qubit
res0, res1 = 0, 0
for state in states:
if state[0] == '0':
res0 += counts[state]
elif state[0] == '1':
res1 += counts[state]
print(states)
print(f"We got 0 {res0} times and 1 {res1} times")
Mold is faster than ld for linking.
Include https://github.com/rui314/setup-mold for linking. As in cda-tum/fiction#210
mqt-qecc
depends on qiskit-terra (>=0.23.0)
https://www.wheelodex.org/projects/mqt-qecc/ which is reaching EoL:
Important
The package qiskit-terra
is not going to be updated after August 15th, 2024. Since Qiskit 0.44 (released on July 27th, 2023), the qiskit
meta-package only contains qiskit-terra
. In Qiskit 1.0 and beyond, the meta-package architecture is removed.
If you are installing or depending on qiskit-terra
, consider changing that to qiskit
: Either qiskit>=0.x,<1
(if you did not transition to Qiskit 1.0 yet) or qiskit>=0.x,<2
(to also include Qiskit 1.*).
Read more.
This PR adds the Release Drafter action to the set of GitHub workflows which should make it easier and more automatic to create releases.
https://github.com/pypa/gh-action-pypi-publish changed the naming convention for action parameters from snake_case to kebab-case. While the old syntax will be supported until the next major version increase, a warning is admitted as of the latest version.
This PR changes the skip_existing
option to skip-existing
to reflect the above change and silence the warning.
Originally posted by hardik954 May 5, 2024
I want to run the "[test_analog_tannergraph_decoding.py] present in the test.python.analog_info in GOOGLE COLAB folder but how do I do it? I have cloned the repo installed all the requirements yet i can't do it. Can someone please help me
The pre-built wheels are not available (i.e. running pip install mqt.qecc errors with "no matching distribution found").
When skipping this step and just trying to clone the repo according to the later instructions (git clone --recurse-submodules -j8 https://github.com/lucasberent/qecc) the clone fails halfway through with the message "clone of '[email protected]/nlohmann/json.git' failed.
current
All OS are affected
No response
No response
qiskit==0.39.4
qiskit-aer==0.11.2
Currently Qiskit's QasmSimulator is used for quantum circuit simulaton in the ecc_framework_qiskit_wrapper. However, in the future, the QasmSimulator will be fully replaced by the AerSimulator of Qiskit.
Using the QasmSimulator causes "PendingDeprecationWarning" warnings. These warnings are currently filtered in pyproject.toml, to not cause errors during the CI checks.
The simulator used to simulate quantum circuits must be switched while making sure that the functionality is not reduced. Afterward, the filtered warnings in pyproject.toml regarding the "PendingDeprecationWarning" warnings can be removed.
Remove the Qiskit PendingDeprecationWarnings of the filter from pyproject.toml. Then running the pytohn tests will cause an error.
At the moment C++20 is required to build QECC. The standard is still pretty new and it's adoption in compilers such as gcc and clang has been slow. As a result, the default version of gcc (9.4.) that comes with the last LTS version of Ubuntu (20.04) is not able to compile the project. While there are multiple solutions, such as upgrading the compiler or switching to the latest LTS version (22.04), this is not possible under all circumstances.
The library itself is not using any crazy new C++20 features. It merely uses the spaceship operator and things like map.contains
. It should be relatively straight forward to lower the requirements of this library to C++17.
QECC should be compatible/compilable with C++17.
Currently flint cannot be auto installed since flint's cmake is broken. For now flint needs to be installed when using the python package on windows.
Nice work! just to confirm some detail.
XZZX
checks?latest
any
any
any
N/A
The example file that is provided in the docs in the walkthrough section (https://qecc.readthedocs.io/en/latest/Installation.html#a-detailed-walk-through) is incomplete and does not work out of the box. It is missing the import of the library.
The example should be complete and executable without modifications.
Copy the code from https://qecc.readthedocs.io/en/latest/Installation.html#a-detailed-walk-through and run the script.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.