Convert a program between formats
convert_programCarry a program between OpenQASM 3, QIR (LLVM text, read under its base and adaptive profiles, written as QIR 2.0) and jeff (its Cap'n Proto message, as base64). The answer is the program written, the program as OpenQASM 3 (what every other tool takes), each note with its code (a rotation at an arbitrary angle, a custom gate read by its name, what a format leaves out), what was read and written, and the check: the output read back and held to the program by the equivalence ladder. A construct a reader cannot hold exactly is refused with its code (Q700 to Q721) and its place: quote the code, and never guess around it. A conversion larger than the service takes is refused with the command that runs it locally.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"to": "<to>"
},
"name": "convert_program"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | The format to write. | |
| from | No | Its format; found from its bytes when not given. | |
| check | No | false: write it without the check. | |
| profile | No | QIR's profile to write: by default base when the program's measurements all come at the end, else adaptive. | |
| program | No | The program's text: OpenQASM or QIR. | |
| program_base64 | No | The program's bytes as base64: jeff. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||