py2qasm cli tool
Closed this issue · 9 comments
Create a cli tool in the qlasskit/tools
package called py2qasm
that receives a python script (file or stdin) in input and outputs qasm code. The python script should contain at least one qlassf function.
- If not specified by --input-file/-i, read from stdin (-).
- If not specified by --entrypoint/-e, func_name is the last qlassf defined.
- If not specified by --output/-o, output to stdout
- If not specified by --compiler/-c use internal compiler (or tweedledum)
- If not specified by --qasm-version/-q use v3 qasm version
py2qasm -i pyfile [-e func_name] [-c internal] -o qasm_file
Provide also:
-h\--help
for usage-v\--version
for qlasskit version
Requirements:
- Code should be placed on
qlasskit/tools
- Use
argparse
for argument parsing - Use
qlasskit.tools.utils
for getting qlassfs from file / string - A test case must be provided in
test_tools.py
- Keep an eye on issue #28
Please read CONTRIBUTING.md before contributing.
Hi, wonderful, please go on and let me know if you need anything.
Hi, @dakk! Can you please share a couple of sample python files to be transpiled?
There is one in the test_tools file linked above. If you need more you can find some example code in test cases and in the docs; let me know if you need something different
I'll start working on this issue
Thank you for the contributions @tomv42 ; I hope you enjoyed working on the qlasskit library: if so, please "star" the project, and tell your quantum friends about qlasskit :)
This was my first experience in open source and I really enjoyed working on qlasskit. I learned a lot. Also, I've already starred the project :)
This was my first experience in open source and I really enjoyed working on qlasskit. I learned a lot. Also, I've already starred the project :)
Great!
@tomv42 Also, if you have an idea about a quantum algorithm to be implemented in qlasskit, you can propose it on this issue #32 still open for unitary hack.
@tomv42 it doesn't look like you registered for unitaryhack, send me an email at kallie@unitary.fund if you want the bounty.