How to monitor activity and retrieve results

Monitor job status and retrieve results from previously run calculations in Boulder Opal

You can use the activity monitor to view the progress and status of previously run actions. Boulder Opal provides multiple ways to accessing this activity monitor. Moreover, each time you perform a calculation using Boulder Opal (e.g. with qctrl.functions.calculate_graph), it is assigned a unique action_id, which you can use to retrieve the results later.

In this user guide we demonstrate how to access the activity monitor and how to retrieve the results of past calculations.

Monitoring activity

Command-line interface

The command-line interface method allows you to use the qctrl activity command through your terminal to view previously run actions. If you have not used the interactive authentication method mentioned here, you will be redirected to the interactive authentication method first. Information on the qctrl activity command can be found as follows:

$ qctrl activity --help

Pagination and filtering by status and action type is supported. All filtering commands are optional. If called without any additional commands the script will return the most recent actions you have run.

$ qctrl activity --limit 10 --offset 0 --status SUCCESS --type ROBUST_OPTIMIZE

The various --status and --type options are viewable through the --options command. For example to view the different type options to filter by, you can run the following command:

$ qctrl activity --options type

Qctrl() object

The activity monitor can also be accessed through the Qctrl() object.

from qctrl import Qctrl

qctrl = Qctrl()
Name                                     Status     Type                                     Progress   Created at               Completed at             Id        

core__calculateStochasticOptimization    SUCCESS    CORE_CALCULATION                         100%       03-08-2021 02:48:27      03-08-2021 02:50:09      528840    

core__calculateOptimization              SUCCESS    CORE_CALCULATION                         100%       03-08-2021 02:47:56      03-08-2021 02:48:16      528839    

core__calculateGraph                     SUCCESS    CORE_CALCULATION                         100%       03-08-2021 02:47:52      03-08-2021 02:47:54      528838    

core__calculateGraph                     SUCCESS    CORE_CALCULATION                         100%       03-08-2021 02:47:17      03-08-2021 02:47:18      528837    

core__calculateFilterFunction            SUCCESS    CORE_CALCULATION                         100%       03-08-2021 02:41:34      03-08-2021 02:41:38      528836    

Note that the times are displayed in UTC. Similarly to the command line option, this option also supports pagination and filtering by status and action type and returns the most recent actions you have run (if no filtering options are provided).

    limit=2, offset=6, status="FAILURE", action_type="CORE_CALCULATION"
Name                                     Status     Type                                     Progress   Created at               Completed at             Id        

core__calculateOptimization              FAILURE    CORE_CALCULATION                         100%       23-07-2021 03:07:47      23-07-2021 03:08:26      520849    

core__calculateFilterFunction            FAILURE    CORE_CALCULATION                         100%       07-07-2021 05:25:14      07-07-2021 05:25:14      493660    

Web Access

The activity monitor can also be accessed through the Boulder Opal web app present here:

Retrieving results

Each call to a function in the qctrl.functions namespace of the Q-CTRL Python Package is assigned a unique action_id. These ids are printed when you call the function, or you can find them in the activity monitor.

You can use the qctrl.get_result method with an action_id to retrieve the result of that call. You can use this in case your connection dropped during a calculation or to retrieve results you forgot to save.


Result(output={'unitary': {'value': array([[-0.56065253+0.43089295j, -0.14358047-0.69237609j],
       [-0.6321134 -0.3169111j , -0.56065253+0.43089295j]])}}, metadata={}, errors=None, action=CoreAction(created_at=None, definition=None, errors=None, job_data=None, job_id=None, model_id='528837', model_type=None, mutation_name=None, name='core__calculateGraph', progress=1.0, result=None, runtime=None, started_at=None, status='SUCCESS', tasks=None, terminated_at=None, updated_at=None, user=None))