Q-CTRL MCP tools

Every tool your AI app can call, with its inputs and outputs

Your AI app sees the tools below once you connect it to Q-CTRL MCP. Each tool has badges that tell you what it does:

  • Read only: the tool only reads data.
  • Deletes data: the tool removes data, such as a saved credential.
  • Uses hardware time: the tool runs circuits on your hardware provider account. Your app should ask you before it calls it.

Account

Who am I

qctrl_whoamiRead only

Show who the agent is signed in as: the user's name and email, the organization they're working in, their other organizations, and which Q-CTRL products each organization can use. Call this when another tool says the organization is missing or access is denied. NOT for listing quantum computers, jobs or results.

Outputs(19)
NameTypeRequiredDescription
userUserYesThe signed-in user.
user.idstringYesThe user's Q-CTRL user ID.
user.emailstringYesThe user's email address.
user.usernamestringYesThe user's username, if set.
user.first_namestringYesThe user's first name, if set.
user.last_namestringYesThe user's last name, if set.
user.statusstringYesThe status of the user's account.
selected_organizationOrganizationSummaryYesThe organization the user works in now, or null if none.
selected_organization.idstringYesThe organization ID.
selected_organization.namestringYesThe organization's display name.
selected_organization.slugstringYesThe organization's short URL name.
organizationsarray of OrganizationYesAll organizations the user is a member of.
organizations[].idstringYesThe organization ID.
organizations[].namestringYesThe organization's display name.
organizations[].slugstringYesThe organization's short URL name.
organizations[].productsarray of ProductYesThe Q-CTRL products the organization can use.
organizations[].products[].namestringYesThe product name.
organizations[].products[].activebooleanYesTrue if the organization can use the product now.
organizations[].products[].rolesarray of stringYesThe product roles in this organization.

Hardware credentials

Add hardware credential

qctrl_add_credential

Ask the user to add a quantum hardware provider credential (IBM Cloud, Amazon Braket or IonQ) for Fire Opal. The user enters the credential on a secure Q-CTRL page, not in the chat. Never ask the user to paste a token or key into the chat. You do not need to call this before a Fire Opal tool: those tools ask for a credential themselves when the user has none. NOT for listing or removing credentials: use qctrl_list_credentials or qctrl_remove_credentials.

Outputs(3)
NameTypeRequiredDescription
namestringYesThe credential name, for credential_name in Fire Opal tools.
provider"ibm_cloud" | "braket" | "ionq"YesThe hardware provider: ibm_cloud, braket or ionq.
expires_atstringYesWhen the server deletes the credential, in UTC: 1 hour, 24 hours or 30 days after saving, as the user chose.

List hardware credentials

qctrl_list_credentialsRead only

List the user's saved quantum hardware provider credentials for Fire Opal: the name, provider and expiry time of each. Use a name as credential_name in Fire Opal tools, or with qctrl_remove_credentials. Secrets are never shown. NOT for adding a credential (use qctrl_add_credential) or for checking that a credential works.

Outputs(4)
NameTypeRequiredDescription
credentialsarray of CredentialYesThe user's saved credentials, sorted by name.
credentials[].namestringYesThe credential name, unique for the user.
credentials[].provider"ibm_cloud" | "braket" | "ionq"YesThe hardware provider: ibm_cloud, braket or ionq.
credentials[].expires_atstringYesWhen the server deletes the credential, in UTC.

Remove hardware credentials

qctrl_remove_credentialsDeletes data

Remove saved quantum hardware provider credentials for Fire Opal, by name. Get the names from qctrl_list_credentials. This cannot be undone; the user must add the credential again to use it. NOT for replacing a credential: run qctrl_add_credential and save with the same name on the credential page.

Inputs(1)
NameTypeRequiredDescription
namesarray of stringYesThe names of the credentials to remove, from qctrl_list_credentials. 1 to 50 names.
Outputs(2)
NameTypeRequiredDescription
removedarray of stringYesThe names of the deleted credentials.
not_foundarray of stringYesThe names the user has no credential for. Nothing was deleted for them.

Fire Opal

Show supported devices

qctrl_fire_opal_show_supported_devicesRead only

List the quantum computers (backends) the user can run Fire Opal on with one of their saved hardware credentials, for example ibm_fez or ibm_torino. Call this before any Fire Opal submit tool to choose a valid backend_name. Free; uses no hardware time. NOT for the results of a past job (use qctrl_get_job). Get credential_name from qctrl_list_credentials.

Inputs(2)
NameTypeRequiredDescription
credential_namestringNoThe saved credential to use, from qctrl_list_credentials. Leave it out to use the user's only credential, or to ask the user.
organizationstringNoThe Q-CTRL organization to run in, by slug, from qctrl_whoami. Leave it out to use the user's only organization with Fire Opal, or to ask the user. Once the user picks one, pass it on later Fire Opal calls.
Outputs(3)
NameTypeRequiredDescription
credential_namestringYesThe saved credential the list is for.
provider"ibm_cloud" | "braket" | "ionq"YesThe credential's hardware provider.
devicesarray of stringYesThe backend names Fire Opal can run with this credential, sorted. Pass one as backend_name to the other Fire Opal tools.

Validate circuits

qctrl_fire_opal_validateRead only

Check OpenQASM circuits for a Fire Opal backend without running them. Returns whether they are valid, what to fix if not (Fire Opal stops at the first invalid circuit), and warnings that may hurt performance. Call this before qctrl_fire_opal_execute when you wrote or changed a circuit, with the same parameters you will run. Free; uses no hardware time. Needs an IBM Cloud or Amazon Braket credential. NOT for qctrl_fire_opal_solve_qaoa, qctrl_fire_opal_simulate_dynamics or qctrl_fire_opal_integrate_monte_carlo, which build their own circuits.

Inputs(9)
NameTypeRequiredDescription
circuitsarray of stringYesThe circuits, as OpenQASM 2.0 or 3 text, 1 to 300, counted from 0 in messages. Each starts with "OPENQASM 2.0;" or "OPENQASM 3.0;" and is under 1 MB.
backend_namestringYesThe backend name, for example ibm_fez, from qctrl_fire_opal_show_supported_devices.
credential_namestringNoThe saved credential to use, from qctrl_list_credentials. Leave it out to use the user's only credential, or to ask the user.
organizationstringNoThe Q-CTRL organization to run in, by slug, from qctrl_whoami. Leave it out to use the user's only organization with Fire Opal, or to ask the user. Once the user picks one, pass it on later Fire Opal calls.
run_optionsRunOptionsNo
run_options.session_idstringNoAn open IBM session to run in.
run_options.job_tagsarray of stringNoTags to add to the IBM jobs, at most 50.
run_options.reduce_approximationbooleanNoAsk Fire Opal to reduce circuit approximation.
parametersarray of objectNoValues for parametric circuits: one set per circuit, in the same order, each mapping a parameter name to its value. Not for braket credentials.
Outputs(5)
NameTypeRequiredDescription
backend_namestringYesThe backend the circuits were checked for.
circuit_countintegerYesHow many circuits were checked.
validbooleanYesTrue if every circuit can run on the backend.
problemsarray of stringYesWhat to fix, empty when valid: every problem the server's own checks found, or Fire Opal's message for the first invalid circuit. Check again after fixing it. Circuits are counted from 0.
warningsarray of stringYesIssues that do not stop the circuits from running but may hurt performance.

Execute circuits

qctrl_fire_opal_executeUses hardware time

Run OpenQASM circuits on quantum hardware (or a provider simulator) with Fire Opal error suppression. The circuits are validated first, and nothing runs if one is invalid. Returns a job_id straight away; then call qctrl_get_job until it shows SUCCESS, and read each circuit's bitstrings with qctrl_fire_opal_get_circuit_results. This uses hardware time on the user's provider account (IBM Cloud or Amazon Braket), so call it only after the user confirms the backend, number of circuits and shots. NOT for expectation values (use qctrl_fire_opal_estimate_expectation) or variational loops (use qctrl_fire_opal_iterate).

Inputs(10)
NameTypeRequiredDescription
circuitsarray of stringYesThe circuits, as OpenQASM 2.0 or 3 text, 1 to 300, counted from 0 in messages. Each starts with "OPENQASM 2.0;" or "OPENQASM 3.0;" and is under 1 MB.
shot_countintegerYesHow many times to run each circuit, 1 to 100000.
backend_namestringYesThe backend name, for example ibm_fez, from qctrl_fire_opal_show_supported_devices.
credential_namestringNoThe saved credential to use, from qctrl_list_credentials. Leave it out to use the user's only credential, or to ask the user.
organizationstringNoThe Q-CTRL organization to run in, by slug, from qctrl_whoami. Leave it out to use the user's only organization with Fire Opal, or to ask the user. Once the user picks one, pass it on later Fire Opal calls.
parametersarray of objectNoValues for parametric circuits: one set per circuit, in the same order, each mapping a parameter name to its value. Not for braket credentials.
run_optionsRunOptionsNo
run_options.session_idstringNoAn open IBM session to run in.
run_options.job_tagsarray of stringNoTags to add to the IBM jobs, at most 50.
run_options.reduce_approximationbooleanNoAsk Fire Opal to reduce circuit approximation.
Outputs(9)
NameTypeRequiredDescription
job_idstringYesThe job ID.
statusstringYesThe job's status when it started, usually PENDING.
workflowstringYesThe Fire Opal workflow the job runs.
backend_namestringYesThe backend the job runs on.
organizationstringYesThe slug of the Q-CTRL organization the job runs in.
warningsarray of stringNoFire Opal's warnings about the circuits that may hurt performance, from validation; empty for jobs whose circuits Fire Opal builds. The job still runs.
next_stepstringYesWhat to call next to follow the job.
circuit_countintegerYesHow many circuits the job runs.
shot_countintegerYesHow many times each circuit runs.

Estimate expectation values

qctrl_fire_opal_estimate_expectationUses hardware time

Run OpenQASM circuits on a real quantum computer with Fire Opal and estimate expectation values of Pauli observables, such as the energy of a Hamiltonian, instead of raw bitstrings. The circuits are validated first, and nothing runs if one is invalid. Returns a job_id straight away; then call qctrl_get_job until it shows SUCCESS, and read the values with qctrl_fire_opal_get_circuit_results (expectation_values field). This uses hardware time on the user's IBM Cloud account, so call it only after the user confirms the backend, circuits, observables and shots. NOT for raw bitstrings (use qctrl_fire_opal_execute) or a step in an optimization loop (use qctrl_fire_opal_iterate_expectation).

Inputs(13)
NameTypeRequiredDescription
circuitsarray of stringYesThe circuits, as OpenQASM 2.0 or 3 text, 1 to 300, counted from 0 in messages. Each starts with "OPENQASM 2.0;" or "OPENQASM 3.0;" and is under 1 MB.
observablesarray of PauliOperatorYesThe observables, 1 to 1000. Fire Opal estimates every observable on every circuit. To get one value per term, such as each edge of a max-cut, give each term as its own observable; to get one total, such as an energy, give one observable with all the terms.
observables[].paulisarray of stringYesThe Pauli strings, 1 to 1000: one letter (I, X, Y or Z) per qubit of the circuits, so each is as long as the circuits' qubit count. In Qiskit order: the rightmost letter acts on qubit 0, so on 3 qubits "ZZI" is Z on qubits 1 and 2.
observables[].coefficientsarray of numberYesThe real weight of each Pauli string, in the same order.
shot_countintegerYesHow many times to run each circuit, 1 to 100000.
backend_namestringYesThe backend name, for example ibm_fez, from qctrl_fire_opal_show_supported_devices.
credential_namestringNoThe saved credential to use, from qctrl_list_credentials. Leave it out to use the user's only credential, or to ask the user.
organizationstringNoThe Q-CTRL organization to run in, by slug, from qctrl_whoami. Leave it out to use the user's only organization with Fire Opal, or to ask the user. Once the user picks one, pass it on later Fire Opal calls.
parametersarray of objectNoValues for parametric circuits: one set per circuit, in the same order, each mapping a parameter name to its value. Not for braket credentials.
run_optionsRunOptionsNo
run_options.session_idstringNoAn open IBM session to run in.
run_options.job_tagsarray of stringNoTags to add to the IBM jobs, at most 50.
run_options.reduce_approximationbooleanNoAsk Fire Opal to reduce circuit approximation.
Outputs(9)
NameTypeRequiredDescription
job_idstringYesThe job ID.
statusstringYesThe job's status when it started, usually PENDING.
workflowstringYesThe Fire Opal workflow the job runs.
backend_namestringYesThe backend the job runs on.
organizationstringYesThe slug of the Q-CTRL organization the job runs in.
warningsarray of stringNoFire Opal's warnings about the circuits that may hurt performance, from validation; empty for jobs whose circuits Fire Opal builds. The job still runs.
next_stepstringYesWhat to call next to follow the job.
circuit_countintegerYesHow many circuits the job runs.
shot_countintegerYesHow many times each circuit runs.

Get circuit results

qctrl_fire_opal_get_circuit_resultsRead only

Get the results of one circuit in a finished Fire Opal job: the most likely bitstrings with their probabilities, or the expectation values for expectation jobs. Call this after qctrl_get_job shows SUCCESS. Circuit IDs are 0 to the number of circuits submitted minus 1, in the order they were submitted. NOT for QAOA, Monte Carlo or dynamics jobs (use qctrl_fire_opal_get_qaoa_results, qctrl_fire_opal_get_monte_carlo_results or qctrl_fire_opal_get_dynamics_results). For the full data in a script, use qctrl_get_results_link.

Inputs(3)
NameTypeRequiredDescription
job_idstringYesThe Fire Opal job ID (digits only).
circuit_idintegerYesThe circuit's position in the submitted list, from 0 to the number of circuits minus 1.
topintegerNoHow many of the most likely outcomes to return, 1 to 100. Ignored for expectation jobs.
Outputs(11)
NameTypeRequiredDescription
job_idstringYesThe job ID.
circuit_idintegerYesThe circuit's position in the submitted list, from 0.
circuit_countintegerYesHow many circuits the job's result has.
histogramarray of OutcomeYesThe most likely outcomes, at most `top`, sorted by probability, then by bitstring. Empty for expectation jobs.
histogram[].bitstringstringYesThe measured bitstring.
histogram[].probabilitynumberYesThe bitstring's probability, from 0 to 1.
histogram_total_outcomesintegerYesHow many distinct outcomes the full histogram has.
other_outcomes_probabilitynumberYesThe total probability of the outcomes not in histogram, rounded to 6 decimal places.
expectation_valuesarray of numberYesThe circuit's expectation values, for expectation jobs only. At most the first 200; expectation_value_count says how many there are.
standard_deviationsarray of numberYesThe standard deviations of expectation_values, when the job has them. At most the first 200.
expectation_value_countintegerYesHow many expectation values the circuit has, including any not in expectation_values. 0 for counts jobs.

Get dynamics results

qctrl_fire_opal_get_dynamics_resultsRead only

Get the result of a finished Fire Opal dynamics simulation job: one time series of expectation values per requested observable, from time 0 to the final evolved state. Call this after qctrl_get_job shows SUCCESS for a job from qctrl_fire_opal_simulate_dynamics. NOT for other job types (use qctrl_get_job to see which results tool fits).

Inputs(1)
NameTypeRequiredDescription
job_idstringYesThe Fire Opal job ID (digits only).
Outputs(8)
NameTypeRequiredDescription
job_idstringYesThe job ID.
seriesarray of ObservableSeriesYesOne time series per submitted observable, in the submitted order, at most 100.
series[].observable_indexintegerYesThe observable's position in the submitted observables list, from 0.
series[].valuesarray of numberYesThe observable's expectation values from time 0: the initial state, then one value after each time step, at most 101.
observable_countintegerYesHow many observables the job returned. More than the series listed when they were cut to 100.
point_countintegerYesHow many values the job returned per observable: one for time 0 and one per time step. More than each series lists when they were cut to 101.
provider_job_idsarray of stringYesThe hardware provider's job IDs, at most 50, each cut to 100 characters.
warningsarray of stringYesFire Opal's warnings about the run, at most 10.

Get Monte Carlo results

qctrl_fire_opal_get_monte_carlo_resultsRead only

Get the result of a finished Fire Opal Monte Carlo integration job: the estimate, its variance and the number of iterations. Call this after qctrl_get_job shows SUCCESS for a job from qctrl_fire_opal_integrate_monte_carlo. NOT for other job types (use qctrl_get_job to see which results tool fits).

Inputs(1)
NameTypeRequiredDescription
job_idstringYesThe Fire Opal job ID (digits only).
Outputs(9)
NameTypeRequiredDescription
job_idstringYesThe job the result is for.
estimatenumberYesThe final estimate of the expected value.
variancenumberYesThe variance of the estimate.
standard_deviationnumberYesThe square root of the variance, in the estimate's units.
iteration_countintegerYesHow many iterations the job ran.
iterationsarray of MonteCarloIterationYesThe estimate after each iteration, at most the last 50, in order. Null unless the job was submitted with full_output.
iterations[].estimatenumberYesThe estimate after this iteration.
iterations[].variancenumberYesThe variance of that estimate.
iterations[].iteration_countintegerYesThe iterations run so far.

Get QAOA results

qctrl_fire_opal_get_qaoa_resultsRead only

Get the results of a finished Fire Opal QAOA job: the best bitstring and its cost, the QAOA parameters that found it, and the most likely measured outcomes. Call this after qctrl_get_job shows SUCCESS for a job from qctrl_fire_opal_solve_qaoa. NOT for other Fire Opal jobs: for circuit jobs use qctrl_fire_opal_get_circuit_results, for Monte Carlo jobs qctrl_fire_opal_get_monte_carlo_results, and for dynamics jobs qctrl_fire_opal_get_dynamics_results.

Inputs(2)
NameTypeRequiredDescription
job_idstringYesThe Fire Opal job ID (digits only).
topintegerNoHow many of the most likely outcomes to return, 1 to 100.
Outputs(16)
NameTypeRequiredDescription
job_idstringYesThe Fire Opal job ID.
solution_bitstringstringYesThe bitstring with the lowest cost that Fire Opal found.
solution_costnumberYesThe cost of solution_bitstring. Lower is better.
best_parametersarray of numberYesThe optimized QAOA beta and gamma values that found the solution.
iteration_countintegerYesHow many optimizer iterations the job ran.
variables_to_bitstring_index_mapobjectYesWhich bitstring position (from 0) holds each problem variable. Empty when the map has more than 200 entries; the summary then says so.
outcomesarray of QaoaOutcomeYesThe most likely measured outcomes, by count (ties by bitstring), at most top of them.
outcomes[].bitstringstringYesThe measured bitstring.
outcomes[].countintegerYesHow many shots measured this bitstring.
outcomes[].probabilitynumberYescount over the total shots in the final distribution, 0 to 1.
outcomes[].costnumberYesThe bitstring's cost from the job's cost map, or null if it has none. Lower is better: Fire Opal minimizes the cost. Only the returned outcomes' costs are kept; get every cost with qctrl_get_results_link.
outcomes[].is_solutionbooleanYesTrue if this is the best solution.
total_outcomesintegerYesHow many distinct bitstrings were measured, outcomes included.
other_outcomes_probabilitynumberYesThe share of shots, 0 to 1, that measured a bitstring not in outcomes.
warningsarray of stringYesFire Opal's warnings about the job, at most 10.
variable_countintegerYesHow many problem variables the job had. When it is more than 200, variables_to_bitstring_index_map is empty; get the full map with qctrl_get_results_link.

Jobs

Get a job

qctrl_get_jobRead only

Get the status of one Q-CTRL job: PENDING, STARTED, SUCCESS, FAILURE and so on, with its workflow, progress and timestamps, and which tool reads its results. Call this after a submit tool to check progress. If the job is still running, wait before checking again (start at 10 seconds; hardware queues can take minutes or hours) and tell the user it is running. NOT for results themselves: use the tool named in next_step.

Inputs(2)
NameTypeRequiredDescription
job_idstringYesThe job ID (digits only), as a submit tool returned it.
product"fire-opal" | "boulder-opal"NoThe Q-CTRL product the job belongs to. Pass boulder-opal for a Boulder Opal job: with the default, it gets Fire Opal's errors and results tools. The lookup is the same for both. Defaults to fire-opal.
Outputs(10)
NameTypeRequiredDescription
job_idstringYesThe job ID.
product"fire-opal" | "boulder-opal"YesThe product the job was looked up for. The API does not say which product ran a job, so this is the product that was asked for.
workflow_typestringYesThe workflow the job runs, without the _workflow suffix, for example compile_and_run, or null if the API does not say.
status"PENDING" | "RECEIVED" | "STARTED" | "RETRY" | "SUCCESS" | "FAILURE" | "REVOKED" or stringYesThe job status: PENDING, RECEIVED, STARTED, RETRY, SUCCESS, FAILURE or REVOKED. A status the server does not know passes through.
created_atstringYesWhen the job was created, or null if the API does not say.
updated_atstringYesWhen the job last changed, or null if the API does not say.
progressnumberYesThe fraction of the job's tasks that have finished, from 0 to 1 (1 once the job ends), or null if the API cannot calculate it.
errorsarray of stringYesWhy a failed job failed, written for the user. Empty when the job did not fail or the error holds nothing safe to show.
is_finishedbooleanYesTrue once the job is SUCCESS, FAILURE or REVOKED.
next_stepstringYesWhat to do next, and which tool to call.

List jobs

qctrl_list_jobsRead only

List the user's own Q-CTRL jobs, newest first, with each job's ID, Fire Opal workflow type, status, progress, and creation and update times. Filter by product, status or Fire Opal workflow type, and page through with limit and offset. A job's product is known only when the call filters by product; otherwise it is null. Filter by product when you need it, and pass the same product to qctrl_get_job. Call this to find a job_id, or to see what is still running. NOT for one job's status or results: use qctrl_get_job.

Inputs(5)
NameTypeRequiredDescription
product"fire-opal" | "boulder-opal"NoOnly this product's jobs. Leave it out for every product.
status"PENDING" | "RECEIVED" | "STARTED" | "RETRY" | "SUCCESS" | "FAILURE" | "REVOKED"NoOnly jobs with this status. Leave it out for every status.
workflow_typestringNoOnly Fire Opal jobs of this workflow, by its short name, for example compile_and_run or solve_qaoa. Not for Boulder Opal.
limitintegerNoHow many jobs to return, 1 to 100.
offsetintegerNoHow many of the newest jobs to skip, for the next page.
Outputs(11)
NameTypeRequiredDescription
jobsarray of JobSummaryYesThe jobs on this page, newest first.
jobs[].job_idstringYesThe job ID, for the tools that read one job or its results.
jobs[].product"fire-opal" | "boulder-opal"YesThe product that ran the job, known only when the call filters by product, otherwise null. Filter by product when you need it, and pass the same product to qctrl_get_job.
jobs[].workflow_typestringYesThe job's workflow, without the _workflow suffix, for example compile_and_run for Fire Opal, or null if the job has none.
jobs[].status"PENDING" | "RECEIVED" | "STARTED" | "RETRY" | "SUCCESS" | "FAILURE" | "REVOKED" or stringYesPENDING or RECEIVED (queued), STARTED or RETRY (running), SUCCESS, FAILURE or REVOKED. A newer status passes through as is.
jobs[].progressnumberYesThe fraction of the job's tasks that have finished, from 0 to 1 (1 once the job ends), or null if the API cannot calculate it.
jobs[].created_atstringYesWhen the job was created, if known.
jobs[].updated_atstringYesWhen the job last changed, if known.
totalintegerYesHow many of the user's jobs match the filters.
has_morebooleanYesTrue if more jobs match after this page.
next_offsetintegerYesThe offset for the next page, or null if this is the last.
qctrl_get_results_linkRead only

Get a short-lived download link for the full results of a finished Fire Opal job, as JSON. Boulder Opal jobs never have a link. Use it when you need all the data in a script, for example to plot, export or analyse it. The link expires soon, so use it right away and do not show it to the user as a permanent link. NOT for a quick look at results: use the results tool that qctrl_get_job names in next_step, which returns a summary.

Inputs(2)
NameTypeRequiredDescription
job_idstringYesThe job ID (digits only), as a submit tool returned it.
product"fire-opal" | "boulder-opal"NoThe Q-CTRL product the job belongs to. Pass boulder-opal for a Boulder Opal job: with the default, it gets Fire Opal's errors and results tools. The lookup is the same for both. Defaults to fire-opal.
Outputs(4)
NameTypeRequiredDescription
job_idstringYesThe job whose results the link downloads.
urlstringYesThe HTTPS download link. It carries its own access, so send no token with it. It expires soon: download it right away.
expires_atstringYesWhen the link stops working, in UTC: 10 minutes after it was made. Download before then, or call this tool again for a new link.
formatstringYesThe format of the results file.

Read Q-CTRL doc

qctrl_get_docRead only

Read a page of the official, current Q-CTRL documentation at docs.q-ctrl.com as markdown, or only one section of it. Long content is cut: the result gives a next_offset to read on, and lists the page's sections so you can read the one you need. Call this with a path and section from qctrl_search_docs. Pass a section when you can: it is shorter than the whole page. NOT for web pages outside the Q-CTRL docs.

Inputs(3)
NameTypeRequiredDescription
pathstringYesThe page path, such as /fire-opal/get-started, as qctrl_search_docs returns it.
sectionstringNoA section anchor from qctrl_search_docs or from this tool's sections, to read only that section. Null reads the whole page.
offsetintegerNoWhere to start reading, in characters into the page or section. Pass the next_offset a previous call returned to read the rest. Defaults to 0.
Outputs(10)
NameTypeRequiredDescription
pathstringYesThe page path that was read.
titlestringYesThe page's title, or its path if it has no title.
sectionstringYesThe section returned, or null for the whole page.
contentstringYesThe page or section, as markdown.
offsetintegerYesWhere content starts, in characters into the page or section.
truncatedbooleanYesTrue if content was cut because it was long. Read the rest from next_offset, or read a section.
next_offsetintegerYesPass it as offset, with the same path and section, to read the rest. Null when content reaches the end.
sectionsarray of DocSectionResultYesEvery section of the page, in order, even when only one is returned.
sections[].anchorstringYesThe section anchor. Pass it as section.
sections[].titlestringYesThe section heading.

Search Q-CTRL docs

qctrl_search_docsRead only

Search the official, current Q-CTRL documentation at docs.q-ctrl.com (Fire Opal, Boulder Opal and their Python packages) and return the best matching sections, each with a short snippet, its page path and section anchor. Call this to learn how a Q-CTRL product, function or option works before using it, then read a hit with qctrl_get_doc. Local copies or notes about Q-CTRL products may be out of date. NOT for the user's own jobs, results or account.

Inputs(2)
NameTypeRequiredDescription
querystringYesWhat to look for, in a few words, for example 'execute circuits on IBM'.
limitintegerNoThe most sections to return, from 1 to 10. Defaults to 5.
Outputs(6)
NameTypeRequiredDescription
hitsarray of DocHitResultYesThe matching docs sections, best first.
hits[].titlestringYesThe heading of the matching section.
hits[].breadcrumbstringYesWhere the page sits in the docs, for example 'Fire Opal'.
hits[].pathstringYesThe page path. Pass it to qctrl_get_doc.
hits[].sectionstringYesThe section anchor. Pass it to qctrl_get_doc as section. Null when the hit is the whole page.
hits[].snippetstringYesAbout 30 words of the section's text, or null if it has none.

Integrate Monte Carlo

qctrl_fire_opal_integrate_monte_carlo

Estimate an expected value, such as a European call option price or delta or a fixed income price, with quantum amplitude estimation on a real quantum computer with Fire Opal. Choose a built-in objective and probability distribution, or pass your own OpenQASM 2.0 state-preparation circuit. Returns a job_id straight away; then call qctrl_get_job until SUCCESS and read the estimate with qctrl_fire_opal_get_monte_carlo_results. This runs many circuits on the user's IBM Cloud account, so call it only after the user confirms the problem, max_iteration_count and backend. NOT for running your own circuits without amplitude estimation (use qctrl_fire_opal_execute).

Inputs(21)
NameTypeRequiredDescription
problemBuiltIn or CircuitYesThe problem: "built_in" with an objective and a distribution, or "circuit" with your own state-preparation circuit.
problem.kindstringYes
problem.objectiveEuropeanCallPricing or EuropeanCallDelta or FixedIncomePricingYesThe objective function, by name.
problem.objective.namestringYes
problem.objective.strike_pricenumberYesThe strike price K.
problem.objective.rescaling_factornumberYesThe approximation scaling factor for the linear payoff.
problem.objective.boundsarray of numberNoThe range of the random variable, matching the distribution's bounds. For a uniform distribution this is the only place the range is set.
problem.distributionUniform or Normal or Lognormal or GaussianConditionalIndependenceYesThe probability distribution, by name.
problem.distribution.namestringYes
problem.distribution.uncertaintyintegerYesHow many discrete points, 2 to 4096. Qubits grow as log2.
backend_namestringYesThe backend name, for example ibm_fez, from qctrl_fire_opal_show_supported_devices.
max_iteration_countintegerYesThe most amplitude estimation iterations, 1 to 100. Agree it with the user before you call: each iteration runs more circuits, and the package recommends at most 20.
integrator_optionsOptionsNo
integrator_options.target_variancenumberNoStop once the estimate's variance is below this.
integrator_options.full_outputbooleanNoReturn each iteration's estimate in the metadata.
credential_namestringNoThe saved credential to use, from qctrl_list_credentials. Leave it out to use the user's only credential, or to ask the user.
organizationstringNoThe Q-CTRL organization to run in, by slug, from qctrl_whoami. Leave it out to use the user's only organization with Fire Opal, or to ask the user. Once the user picks one, pass it on later Fire Opal calls.
run_optionsRunOptionsNo
run_options.session_idstringNoAn open IBM session to run in.
run_options.job_tagsarray of stringNoTags to add to the IBM jobs, at most 50.
run_options.reduce_approximationbooleanNoAsk Fire Opal to reduce circuit approximation.
Outputs(11)
NameTypeRequiredDescription
job_idstringYesThe job ID.
statusstringYesThe job's status when it started, usually PENDING.
workflowstringYesThe Fire Opal workflow the job runs.
backend_namestringYesThe backend the job runs on.
organizationstringYesThe slug of the Q-CTRL organization the job runs in.
warningsarray of stringNoFire Opal's warnings about the circuits that may hurt performance, from validation; empty for jobs whose circuits Fire Opal builds. The job still runs.
next_stepstringYesWhat to call next to follow the job.
circuit_countnullNoAlways null: Fire Opal builds the circuits.
problemstringYesWhat was submitted, in a few words.
shot_countintegerNoHow many times each circuit runs, or null when Fire Opal picks it.
max_iteration_countintegerYesThe most iterations asked for, as passed in.

Run variational loop step

qctrl_fire_opal_iterate

Run one step of a variational (hybrid quantum-classical) loop on real hardware with Fire Opal, returning a job_id straight away. Fire Opal keeps a hardware session open between steps, so ALWAYS call qctrl_fire_opal_stop_iterate when the loop ends, fails or the user stops it. Call this once per step, after agreeing a maximum number of steps with the user, and pass step and max_steps; each step uses hardware time on the user's IBM Cloud account. Between steps, call qctrl_get_job until SUCCESS, read the bitstrings with qctrl_fire_opal_get_circuit_results and choose new parameters yourself. NOT for a single run (use qctrl_fire_opal_execute) or expectation values (use qctrl_fire_opal_iterate_expectation).

Inputs(12)
NameTypeRequiredDescription
circuitsarray of stringYesThe circuits, as OpenQASM 2.0 or 3 text, 1 to 300, counted from 0 in messages. Each starts with "OPENQASM 2.0;" or "OPENQASM 3.0;" and is under 1 MB.
shot_countintegerYesHow many times to run each circuit, 1 to 100000.
backend_namestringYesThe backend name, for example ibm_fez, from qctrl_fire_opal_show_supported_devices.
credential_namestringNoThe saved credential to use, from qctrl_list_credentials. Leave it out to use the user's only credential, or to ask the user.
organizationstringNoThe Q-CTRL organization to run in, by slug, from qctrl_whoami. Leave it out to use the user's only organization with Fire Opal, or to ask the user. Once the user picks one, pass it on later Fire Opal calls.
parametersarray of objectNoValues for parametric circuits: one set per circuit, in the same order, each mapping a parameter name to its value. Not for braket credentials.
run_optionsRunOptionsNo
run_options.session_idstringNoAn open IBM session to run in.
run_options.job_tagsarray of stringNoTags to add to the IBM jobs, at most 50.
run_options.reduce_approximationbooleanNoAsk Fire Opal to reduce circuit approximation.
stepintegerNoThe loop step this call runs, counted from 1. Circuits are validated on step 1 (or when left out) only, so on later steps keep the same circuits as step 1 and change only parameters. The step limit applies only when you pass both step and max_steps.
max_stepsintegerNoThe most steps the user agreed to, 1 to 500. Pass the same value on every step; a step above it runs nothing.
Outputs(12)
NameTypeRequiredDescription
job_idstringYesThe job ID.
statusstringYesThe job's status when it started, usually PENDING.
workflowstringYesThe Fire Opal workflow the job runs.
backend_namestringYesThe backend the job runs on.
organizationstringYesThe slug of the Q-CTRL organization the job runs in.
warningsarray of stringNoFire Opal's warnings about the circuits that may hurt performance, from validation; empty for jobs whose circuits Fire Opal builds. The job still runs.
next_stepstringYesWhat to call next to follow the job.
circuit_countintegerYesHow many circuits the job runs.
shot_countintegerYesHow many times each circuit runs.
credential_namestringYesThe saved credential the loop runs with. Pass it, with backend_name, to qctrl_fire_opal_stop_iterate.
stepintegerNoThe loop step this job runs, as passed in.
max_stepsintegerNoThe step limit the user agreed, as passed in.

Run expectation loop step

qctrl_fire_opal_iterate_expectation

Run one step of a variational loop on real hardware with Fire Opal and estimate expectation values of Pauli observables, for example the energy in VQE. Returns a job_id straight away. Fire Opal keeps a hardware session open between steps, so ALWAYS call qctrl_fire_opal_stop_iterate when the loop ends, fails or the user stops it. Call this once per step, after agreeing a maximum number of steps with the user, and pass step and max_steps; each step uses hardware time on the user's IBM Cloud account. Between steps, call qctrl_get_job until SUCCESS, read expectation_values with qctrl_fire_opal_get_circuit_results and choose new parameters yourself. NOT for a single estimate (use qctrl_fire_opal_estimate_expectation) or raw bitstrings (use qctrl_fire_opal_iterate).

Inputs(15)
NameTypeRequiredDescription
circuitsarray of stringYesThe circuits, as OpenQASM 2.0 or 3 text, 1 to 300, counted from 0 in messages. Each starts with "OPENQASM 2.0;" or "OPENQASM 3.0;" and is under 1 MB.
observablesarray of PauliOperatorYesThe observables, 1 to 1000. Fire Opal estimates every observable on every circuit. To get one value per term, such as each edge of a max-cut, give each term as its own observable; to get one total, such as an energy, give one observable with all the terms.
observables[].paulisarray of stringYesThe Pauli strings, 1 to 1000: one letter (I, X, Y or Z) per qubit of the circuits, so each is as long as the circuits' qubit count. In Qiskit order: the rightmost letter acts on qubit 0, so on 3 qubits "ZZI" is Z on qubits 1 and 2.
observables[].coefficientsarray of numberYesThe real weight of each Pauli string, in the same order.
shot_countintegerYesHow many times to run each circuit, 1 to 100000.
backend_namestringYesThe backend name, for example ibm_fez, from qctrl_fire_opal_show_supported_devices.
credential_namestringNoThe saved credential to use, from qctrl_list_credentials. Leave it out to use the user's only credential, or to ask the user.
organizationstringNoThe Q-CTRL organization to run in, by slug, from qctrl_whoami. Leave it out to use the user's only organization with Fire Opal, or to ask the user. Once the user picks one, pass it on later Fire Opal calls.
parametersarray of objectNoValues for parametric circuits: one set per circuit, in the same order, each mapping a parameter name to its value. Not for braket credentials.
run_optionsRunOptionsNo
run_options.session_idstringNoAn open IBM session to run in.
run_options.job_tagsarray of stringNoTags to add to the IBM jobs, at most 50.
run_options.reduce_approximationbooleanNoAsk Fire Opal to reduce circuit approximation.
stepintegerNoThe loop step this call runs, counted from 1. Circuits are validated on step 1 (or when left out) only, so on later steps keep the same circuits as step 1 and change only parameters. The step limit applies only when you pass both step and max_steps.
max_stepsintegerNoThe most steps the user agreed to, 1 to 500. Pass the same value on every step; a step above it runs nothing.
Outputs(12)
NameTypeRequiredDescription
job_idstringYesThe job ID.
statusstringYesThe job's status when it started, usually PENDING.
workflowstringYesThe Fire Opal workflow the job runs.
backend_namestringYesThe backend the job runs on.
organizationstringYesThe slug of the Q-CTRL organization the job runs in.
warningsarray of stringNoFire Opal's warnings about the circuits that may hurt performance, from validation; empty for jobs whose circuits Fire Opal builds. The job still runs.
next_stepstringYesWhat to call next to follow the job.
circuit_countintegerYesHow many circuits the job runs.
shot_countintegerYesHow many times each circuit runs.
credential_namestringYesThe saved credential the loop runs with. Pass it, with backend_name, to qctrl_fire_opal_stop_iterate.
stepintegerNoThe loop step this job runs, as passed in.
max_stepsintegerNoThe step limit the user agreed, as passed in.

Simulate dynamics

qctrl_fire_opal_simulate_dynamics

Simulate how a 1D Fermi-Hubbard chain of up to 64 sites evolves in time on a real quantum computer with Fire Opal, and estimate occupation-number observables at each Trotter step, from time 0. Fire Opal builds the circuits from the model, initial state and Trotter steps. Returns a job_id straight away; then call qctrl_get_job until SUCCESS and read the observable time series with qctrl_fire_opal_get_dynamics_results. This uses hardware time on the user's IBM Cloud account, which grows with step_count and the chain size (2 qubits per site), so call it only after the user confirms the chain size, number of steps, shots and backend. NOT for running your own circuits (use qctrl_fire_opal_execute).

Inputs(15)
NameTypeRequiredDescription
modelModelYesA 1D Fermi-Hubbard chain with open ends, the only model Fire Opal has.
model.hopping_amplitudenumber or array of numberYesThe hopping amplitude t: one number for every bond, or one per bond (one fewer than the sites). List index i is the bond between sites i and i+1, so lists run from site 0, the reverse of initial_state.
model.on_site_interactionnumber or array of numberYesThe on-site interaction U: one number for every site, or one per site, from site 0.
model.chemical_potentialnumber or array of numberNoThe chemical potential mu: one number for every site, or one per site, from site 0. Defaults to 0.
initial_statestringYesThe starting occupation of each site, one character per site, 1 to 64 sites: e (empty), u (spin up), d (spin down) or b (both). The rightmost character is site 0, so "eeeu" puts one spin-up fermion on site 0 of a 4-site chain.
simulationSimulationYesTrotter time evolution.
simulation.time_stepnumberYesThe time step dt, in inverse units of the model's energies.
simulation.step_countintegerYesHow many Trotter steps of time_step, 1 to 100. The total time is step_count * time_step, and Fire Opal reports each observable at step_count + 1 times, from 0.
observablesarray of ObservableYesThe observables to estimate at each step, 1 to 100.
observables[].operatorsarray of array of OccupationYesThe operators: each is a product of occupations, for example [{"spin": "Nup", "site": 3}] for n(3, up).
observables[].coefficientsarray of numberYesThe weight of each operator, in the same order.
shot_countintegerYesHow many times to run each circuit, 1 to 100000.
backend_namestringYesThe backend name, for example ibm_fez, from qctrl_fire_opal_show_supported_devices.
credential_namestringNoThe saved credential to use, from qctrl_list_credentials. Leave it out to use the user's only credential, or to ask the user.
organizationstringNoThe Q-CTRL organization to run in, by slug, from qctrl_whoami. Leave it out to use the user's only organization with Fire Opal, or to ask the user. Once the user picks one, pass it on later Fire Opal calls.
Outputs(10)
NameTypeRequiredDescription
job_idstringYesThe job ID.
statusstringYesThe job's status when it started, usually PENDING.
workflowstringYesThe Fire Opal workflow the job runs.
backend_namestringYesThe backend the job runs on.
organizationstringYesThe slug of the Q-CTRL organization the job runs in.
warningsarray of stringNoFire Opal's warnings about the circuits that may hurt performance, from validation; empty for jobs whose circuits Fire Opal builds. The job still runs.
next_stepstringYesWhat to call next to follow the job.
circuit_countnullNoAlways null: Fire Opal builds the circuits.
problemstringYesWhat was submitted, in a few words.
shot_countintegerNoHow many times each circuit runs, or null when Fire Opal picks it.

Solve with QAOA

qctrl_fire_opal_solve_qaoa

Solve a combinatorial optimization problem on a real quantum computer with the Fire Opal QAOA solver, which builds and tunes the circuits itself. Give a graph with problem_type ("maxcut" or "max-<k>-cut"), a QUBO/HUBO cost function to minimize as a list of terms over binary variables, or a diagonal Ising Hamiltonian as Pauli strings of I and Z. Returns a job_id straight away; then call qctrl_get_job until SUCCESS (QAOA jobs can take many minutes) and read the answer with qctrl_fire_opal_get_qaoa_results. This runs many circuits on the user's IBM Cloud or IonQ account, so call it only after the user confirms the problem size and backend. NOT for running your own circuits (use qctrl_fire_opal_execute) or expectation values (use qctrl_fire_opal_estimate_expectation).

Inputs(16)
NameTypeRequiredDescription
problemGraph or Polynomial or IsingHamiltonianYesThe problem, by kind: "graph", "polynomial" (QUBO/HUBO) or "pauli" (diagonal Ising Hamiltonian).
problem.kindstringYes
problem.nodesinteger or array of integerYesThe nodes: a count n for nodes 0 to n-1, or the node numbers. At least 2. QAOA needs one qubit per node, so keep the count within the backend's qubits (for example 156 on IBM Heron); a larger graph is rejected when the job runs.
problem.edgesarray of EdgeYesThe edges, each once, between nodes in nodes.
problem.edges[].sourceintegerYesOne node of the edge.
problem.edges[].targetintegerYesThe other node of the edge.
problem.edges[].weightnumberNoThe edge weight. Leave it out for weight 1.
problem.problem_typestringYesThe graph problem: "maxcut", or "max-<k>-cut" with k of 2 or more, for example "max-3-cut".
backend_namestringYesThe backend name, for example ibm_fez, from qctrl_fire_opal_show_supported_devices.
constraintsarray of array of integer or stringNoOne-hot constraints: each group lists variables of which exactly one is 1 in the answer. Name graph nodes by number, cost function variables by name, and Ising qubits by index (0 is the rightmost letter). Leave it out for an unconstrained problem, and for max-<k>-cut with k above 2, where Fire Opal builds them.
credential_namestringNoThe saved credential to use, from qctrl_list_credentials. Leave it out to use the user's only credential, or to ask the user.
organizationstringNoThe Q-CTRL organization to run in, by slug, from qctrl_whoami. Leave it out to use the user's only organization with Fire Opal, or to ask the user. Once the user picks one, pass it on later Fire Opal calls.
run_optionsRunOptionsNo
run_options.session_idstringNoAn open IBM session to run in.
run_options.job_tagsarray of stringNoTags to add to the IBM jobs, at most 50.
run_options.reduce_approximationbooleanNoAsk Fire Opal to reduce circuit approximation.
Outputs(10)
NameTypeRequiredDescription
job_idstringYesThe job ID.
statusstringYesThe job's status when it started, usually PENDING.
workflowstringYesThe Fire Opal workflow the job runs.
backend_namestringYesThe backend the job runs on.
organizationstringYesThe slug of the Q-CTRL organization the job runs in.
warningsarray of stringNoFire Opal's warnings about the circuits that may hurt performance, from validation; empty for jobs whose circuits Fire Opal builds. The job still runs.
next_stepstringYesWhat to call next to follow the job.
circuit_countnullNoAlways null: Fire Opal builds the circuits.
problemstringYesWhat was submitted, in a few words.
shot_countintegerNoHow many times each circuit runs, or null when Fire Opal picks it.

Stop iterate

qctrl_fire_opal_stop_iterateDeletes data

Close the hardware session that qctrl_fire_opal_iterate or qctrl_fire_opal_iterate_expectation keeps open on a backend for a credential, so it stops holding the user's hardware time. Fire Opal keys the session by backend and credential: loops on the same backend with the same credential share it, and this closes it for all of them, so do not call it while another such loop is still running. Call this when a variational loop finishes, fails or the user stops it, with the backend_name, credential_name and organization the loop used. Safe to call more than once, and when no session is open. Uses no hardware time. NOT for cancelling a single job: the server cannot cancel jobs yet.

Inputs(3)
NameTypeRequiredDescription
backend_namestringYesThe backend name, for example ibm_fez, from qctrl_fire_opal_show_supported_devices.
credential_namestringNoThe saved credential to use, from qctrl_list_credentials. Leave it out to use the user's only credential, or to ask the user.
organizationstringNoThe Q-CTRL organization to run in, by slug, from qctrl_whoami. Leave it out to use the user's only organization with Fire Opal, or to ask the user. Once the user picks one, pass it on later Fire Opal calls.
Outputs(2)
NameTypeRequiredDescription
backend_namestringYesThe backend the session was on.
organizationstringYesThe slug of the Q-CTRL organization the call ran in.

Was this useful?

cta background

New to Agent Resources?

Connect AI apps and coding agents to Q-CTRL with Q-CTRL MCP and plugins.