Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QI2-1122] Added compiler_config for compilation stages #10

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions schemas/get_static/reply_success.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,67 @@
"description": "Timestamp of start-up of the system (return value of time.time())",
"title": "Starttime",
"type": "number"
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The schemas are automatically generated from the pydantic models in the platform. Arguably, we should describe the format in the markdown files. They are a bit more readable, and not auto-generated.

That being said, am I right in understanding that this would translate to something like:

[
    {
        "compiler_stage": "mapped",
        "compiler_passes": [
            {
                "decomposer": "MckayDecomposer",
                "merge_single_qubit_gates": true
            }
        ]
    }
]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit hesitant to divide the compiler passes up into stages right now. Why not just a flat list of passes? Especially since we know that the current categorization doesn't make sense for QI (scheduled is not a part of OpenSquirrel, and routing is missing).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, doesn't this schema enforce that every pass is a decomposer? Why not something a bit more generic like:

{
    "compiler_passes": [ 
        { 
            "name": "MckayDecomposer", 
            "arguments": {
                "merge_single_qubit_gates": true 
            }
        } ]
 }

"compiler_config": {
"description": "Array of compiler configurations, each containing a stage name and required passes as decomposers.",
"type": "array",
"items": {
"type": "object",
"properties": {
"compiler_stage": {
"description": "Name of the compilation stage.",
"type": "string",
"enum": [
"none",
"mapped",
"native_gateset",
"scheduled"
]
},
"compiler_passes": {
"description": "List of compiler passes required for this stage as decomposers.",
"type": "array",
"items": {
"type": "object",
"properties": {
"decomposer": {
"description": "Decomposer for this compiler pass.",
"type": "string"
},
"decomposer_args": {
"description": "Configurable arguments for the decomposer.",
"type": "object",
"properties": {
"merge_single_qubit_gates": {
"description": "Whether to merge single qubit gates.",
"type": [
"boolean",
"null"
],
"default": true
}
},
"additionalProperties": {
"type": [
"boolean",
"number",
"string",
"null"
]
}
}
},
"required": [
"decomposer"
]
}
}
},
"required": [
"compiler_stage",
"compiler_passes"
]
}
}
},
"required": [
Expand Down
Loading