Views
No views yet
1from transformers import pipeline
2
3question = """Design a QASM 3.0 quantum circuit with 3 qubits and 3 layers to solve the vertex_cover \
4given the graph: {"directed": false, "multigraph": false, "graph": {}, "nodes": [{"id": 0}, {"id": 1}, {"id": 2}], \
5"edges": [{"source": 0, "target": 1}, {"source": 0, "target": 2}, {"source": 1, "target": 2}]}. \
6Provide valid QASM 3.0 code with optimal parameters."""
7generator = pipeline("text-generation", model="Benyucong/sft_quantum_circuit_gen_8B", device="cuda")
8output = generator([{"role": "user", "content": question}], max_new_tokens=1024, return_full_text=False)[0]
9print(output["generated_text"])1@misc{jern2025agentqfinetuninglargelanguage,
2 title={Agent-Q: Fine-Tuning Large Language Models for Quantum Circuit Generation and Optimization},
3 author={Linus Jern and Valter Uotila and Cong Yu and Bo Zhao},
4 year={2025},
5 eprint={2504.11109},
6 archivePrefix={arXiv},
7 primaryClass={quant-ph},
8 url={https://arxiv.org/abs/2504.11109},
9}1@misc{vonwerra2022trl,
2 title = {{TRL: Transformer Reinforcement Learning}},
3 author = {Leandro von Werra and Younes Belkada and Lewis Tunstall and Edward Beeching and Tristan Thrush and Nathan Lambert and Shengyi Huang and Kashif Rasul and Quentin Gallouédec},
4 year = 2020,
5 journal = {GitHub repository},
6 publisher = {GitHub},
7 howpublished = {\url{https://github.com/huggingface/trl}}
8}