Giter VIP home page Giter VIP logo

qir-testing's Introduction

Project

This repo contains sample circuits and programs along with QIR for testing of QIR based tooling.

Test Case Structure

Python

Qiskit based test circuits should have unique names that are valid file/directory names.

  • python/src
    • adaptive_cirquits.py contains test cases leveraging conditions based on measurement results. Test cases should return Generator[QuantumCircuit, Any, Any] for circuits.
    • circuits.py contains test circuits.
    • gates.py contains gate definitions which are transpiled to the target gate set along with their controlled, power, and inverse. Test cases should return List[QuantumCircuit] and call generate_circuits with the appropriate parameters for creating their variations.

Output Folder Structure

The python/artifacts directory contains a folder per test case (e.g. duplicate_conditions, hidden_shift). Within each test case's directory is a folder for each execution target profile (e.g. target_4bf9, target_7ee0). Finally, within each execution target, there is a folder for each execution profile supported for that target (e.g. AdaptiveExecution).

Each test case/target/profile combination includes:

  • Input of either
    • QIR source src_ir.ll and bitcode src_qir.bc files representing the test case
    • generation_error.txt when the test case cannot be generate valid QIR for the chosen provider/profile
  • An OpenQASM circuit.qasm representing the test cases circuit. This file may not exist as OpenQASM cannot represent all test cases.
  • QIR output of either
    • QIR source targeted_ir.ll and bitcode targeted_qir files with the provider/profile targeted QIR.
    • qir_processing_error.txt containing the validation or transformation errors associated with the targeting of the QIR.
  • Simulation output of either
    • hist.txt containing a sample histogram from simulating the circuit.
    • simulation_error.txt containing the simulation errors encountered when running the circuit.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

qir-testing's People

Contributors

idavis avatar microsoft-github-operations[bot] avatar microsoftopensource avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

isabella232

qir-testing's Issues

endian circuits

May I suggest a set of test circuits which look like this:

def endian_circuits():
    for pos in range(3):
        qr = QuantumRegister(3)
        cr = ClassicalRegister(3)
        qc = QuantumCircuit(qr, cr, name=f"endian{pos}")
        qc.x(pos)
        qc.measure(qr, cr)
        yield qc

    for pos in range(3):
        qr = QuantumRegister(3)
        cr = [ClassicalRegister(3) for _ in range(3)]
        qc = QuantumCircuit(qr, *cr, name=f"endian{pos}cr3")
        qc.x(pos)
        qc.measure(qr[pos], cr[pos][pos])
        yield qc

    for pos in range(3):
        qr = QuantumRegister(3)
        cr = [ClassicalRegister(1) for _ in range(3)]
        qc = QuantumCircuit(qr, *cr, name=f"endian{pos}cr1")
        qc.x(pos)
        qc.measure(qr[pos], cr[pos])
        yield qc

I'll note I've created an issue related to these circuits: microsoft/azure-quantum-python#361

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.