Package: dqcsim-cqasm
DQCsim cQASM frontendSee also:DQCsimandlibqasm.This repository contains some glue code to allow DQCsim to run cQASM files
(file extension*.cq).StatusThe implementation is currentlyincomplete. The following things are
missing:The error model specified in the cQASM file is ignored. You'll have to
configure stuff related to error modeling yourself through the respective
simulation backend and/or operators.measure_parityis not implemented.InstallYou can install usingpipusingpip install dqcsim-cqasmor equivalent.
If you're installing with--user, make sure that the path Python installs
the executables into is in your system path, otherwise DQCsim will not be
able to find the plugin. A simple way to see where the files are installed
is to runpip uninstall dqcsim-cqasm; it shows which files it's about to
delete before querying for confirmation.Building/installing from sourceMake sure all git submodules are checked out:git submodule update --init --recursiveBuild the wheel file locally:python3 setup.py build bdist_wheelInstall the wheel file you just built:pip install target/python/dist/*(or equivalent)Don't push a build like this to PyPI or attempt to distribute this wheel; it
will likely only work locally due to hardcoded paths and the likes. Refer torelease.mdfor more info.UsageOnce the plugin is installed, DQCsim will parse any file with a.cqfile
extension as a cQASM file through this plugin, so something likedqcsim test.cq qxshould work (assumingdqcsim-qxis installed andtest.cqexists).The frontend ignores any arguments passed to itsruncallback and doesn't
have anything useful to return (it just echoes back what you passed it).As with QX, thedisplay_binary"gate" is used to print simulation results
to the terminal by means of printing the most recent measurement state. The
frontend also outputs the measurement register contents at the end of the
program as the ArbData returned by therun()call, in the following format:{
    "qubits": [
        {  /* data for qubit 0 */
            "value": <value in qubit measurement register as 0 or 1>,
            "average": <measurement averaging register value>,
            "raw": <raw value returned by backend; 0 or 1, or null for undefined>,
            "json": <JSON part of the optional ArbData associated with the measurement>,
            "binary": [
                [<bytes of binary string 0 of ArbData associated with measurement>],
                [<bytes of binary string 1>],
                <etc., empty list if no ArbData>
            ]
        },
        {<data for qubit 1>},
        {<data for qubit 2>},
        <etc. for all qubits>
    ]
}Theraw,json, andbinarykeys are not present when the qubit was never
measured at all.valuedefaults to 0 in that case.averageis only present
when the qubit has been measured since the latestreset_averagingoperation.Thedisplay"gate" doesn't provide any additional information overdisplay_binary, as DQCsim frontends don't know what the actual quantum state
is; this information is private to the backend. Refer to the documentation of
the backend for ways to get additional information, if any. Be aware that
DQCsim's qubit numbering starts at one, so the cQASM frontend adds 1 to the
zero-referenced cQASM qubit indices to convert.There is currently no way to attach arbs to gates or to the qubits themselves.
If you need to do this, you can write an operator and insert it immediately
behind the cQASM frontend.