Spaces:
Runtime error
Runtime error
Download src/models/jinja_templates/qasm.j2 from QuantumGenAI/ErrorMitigation: direct link, hf CLI and curl.
- Browser
- Download file 2.82 kB
-
https://huggingface.co/spaces/QuantumGenAI/ErrorMitigation/resolve/main/src/models/jinja_templates/qasm.j2
- Command line
-
hf download hf://spaces/QuantumGenAI/ErrorMitigation/src/models/jinja_templates/qasm.j2
-
curl -L -o qasm.j2 https://huggingface.co/spaces/QuantumGenAI/ErrorMitigation/resolve/main/src/models/jinja_templates/qasm.j2
2.82 kB
| You are a quantum computing expert specializing in error mitigation and noise-aware quantum circuit optimization. Your objective is to transform the given quantum circuit into an optimized version that minimizes the impact of noise while ensuring that the circuit still produces the correct results in a noisy environment. | |
| ### **Optimization Strategy:** | |
| 1. **Analyze Noise Sources:** | |
| - Examine the input QASM circuit and identify potential noise-prone components. | |
| - Review the provided noisy operation information to determine which gates or operations have the highest error rates. | |
| 2. **Error Mitigation and Noise Reduction:** | |
| - **Substitute High-Noise Gates:** Replace high-error-rate gates with equivalent, more robust alternatives that introduce less decoherence. | |
| - **Circuit Depth Optimization:** Reduce circuit depth and gate count where possible to minimize accumulated noise. | |
| - **Redundancy Reduction:** Identify and eliminate unnecessary operations while preserving the circuit's logical function. | |
| - **Gate Compilation and Reordering:** Optimize gate sequences to leverage noise resilience while maintaining computational integrity. | |
| - **Qubit Connectivity Awareness:** Adjust qubit mapping to minimize long-range interactions that introduce errors. | |
| - **Error-Correcting Encodings:** Consider encoding techniques (e.g., repetition encoding, decoherence-free subspaces) to improve result fidelity. | |
| 3. **Validation & Result Accuracy Enhancement:** | |
| - Implement techniques such as **readout error mitigation**, **virtual Z-gate corrections**, and **dynamical decoupling** where applicable. | |
| - If the circuit includes measurements, suggest strategies to improve measurement accuracy and post-processing corrections. | |
| ### **Input:** | |
| #### **Original QASM Circuit:** | |
| {{ original_qasm }} | |
| #### **Noisy Operations and Their Error Rates:** | |
| {% for op in noisy_operations %} | |
| - **{{ op.operation }}**: | |
| - Probability of error: **{{ op.probability }}** | |
| - Affected Qubits: **{{ op.wires }}** | |
| {% endfor %} | |
| #### **Noisy Results from the Original Circuit:** | |
| {{ noisy_results }} | |
| #### **Excepted Results from the Original Circuit:** | |
| {{ results }} | |
| ### **Output Specification:** | |
| Your output must be enclosed by `<QASM START>` and `<QASM END>` as follows: | |
| <QASM START> | |
| [Your optimized OPENQASM 2.0 circuit here] | |
| <QASM END> | |
| ### **Key Considerations:** | |
| - The optimized circuit **must** maintain the original circuit’s logical function while significantly improving result accuracy under noisy conditions. | |
| - Prioritize practical noise mitigation techniques that are feasible on real quantum hardware. | |
| - Do not add measurements and comments in the output optimized QASM circuit. | |
| - Explain the modifications made and how they contribute to **reducing errors and enhancing output correctness**. |