CQCL / pytket-qir

Public repo for the pytket-qir package
Apache License 2.0
6 stars 1 forks source link

QASM file causes can't support more than 64 bits in a regiser error #122

Closed peter-campora closed 5 months ago

peter-campora commented 6 months ago

The attached qasm file, qec.txt, when loaded into pytket, then using pytket-qir causes the following error message to be generated:

qir_prog = pytket_to_qir(circuit, name='test_pytket_qir', qir_format=QIRFormat.STRING)
  File "/home/pete/hqcompiler-dev/lib/python3.10/site-packages/pytket/qir/conversion/api.py", line 80, in pytket_to_qir
    raise ValueError("classical registers must not have more than 64 bits")
ValueError: classical registers must not have more than 64 bits

This was generated on the latest pytket-qir release 0.8.0

cqc-melf commented 6 months ago

Thank you for reporting! I is expected behaviour and a documentation issue.

If you would run qir_prog = pytket_to_qir(circuit, name='test_pytket_qir', qir_format=QIRFormat.STRING, cut_pytket_register=True) it would work.

We did not wanted to do any changes to the circuit in the conversion, so we decided that we did not want to do the cutting by default. I think it would be good to improve the error message for this. I will make a PR later this week.

peter-campora commented 6 months ago

Thanks for reporting that cut_pytket_register flag. I'll update my example notebooks to mention this.

peter-campora commented 6 months ago

Have been out on vacation, so haven't checked if the pull request to improve the error message went in. Do you want me to close the issue?

cqc-melf commented 6 months ago

Have been out on vacation, so haven't checked if the pull request to improve the error message went in. Do you want me to close the issue?

I just made the PR, got a bit short on time for the in the last weeks. If this works for you and there are no other issues this can be closed now

peter-campora commented 5 months ago

Not needed.