ProjectQ-Framework / ProjectQ

ProjectQ: An open source software framework for quantum computing
https://projectq.ch
Apache License 2.0
881 stars 272 forks source link

Qasm interface #380

Open yourball opened 3 years ago

yourball commented 3 years ago

Hi!

It seems that ProjectQ doesn't fully support QASM interface for loading/saving algorithms in .qasm format. The only related functionality I was able to find is the method .get_qasm() for IBMbackend. Also it works only for circuits that are appropriate for IBM backend.

QASM interface is a very important component in popular quantum compilation frameworks such as Qiskit, Cirq, tket, Quil. And the absence of such limits potential audience and makes it very hard to use ProjectQ. I was wondering if there were any attempts to create a proper OpenQasm interface in ProjectQ?

A related point about OpenQASMEngine was discussed in #345 by @Takishima.

Qiskit has OpenQasm parser that should be relatively easy to integrate to ProjectQ.

Thanks!

Takishima commented 3 years ago

If possible I would like to avoid introducing some more external dependencies to ProjectQ. Particularly with other quantum computing frameworks. That being said, an OpenQASM interface for loading/saving .qasm files from ProjectQ is something that we would seriously consider. I can't make any precise promises when I could make that a reality, but I will try to implement and propose something going in that direction in the next few weeks.

Takishima commented 3 years ago

@yourball I have now pushed a new version of my feature/openqasm branch. Have a look at it and let me know if you encounter any issues.

The code is currently still rather experimental and does require qiskit to be installed. I might introduce a version that does not require qiskit some time in the next few days.

Takishima commented 3 years ago

Just pushed a few more changes which include some bug fixes and a parser based on Pyparsing (instead of Qiskit).

pedromartinssouza commented 6 months ago

@Takishima, @yourball, I know a long time has passed but is this still relevant? Are we still considering implementing QASM translation to ProjectQ?

Takishima commented 6 months ago

The PR is still open. I will try to ping @andreashehn to review it.