Your IDE comes pre-configured with the QCS Command-Line Interface (CLI). The CLI allows you to view a list of available QPU lattices, and easily book and manage reservations. The CLI is available directly after logging into your IDE, or from a terminal window of your JupyterLab notebook environment.
Once you've connected to your IDE, you can list all available CLI commands with the following command:
$ qcs helpThe Rigetti QCS Command Line Interface (CLI)VERSIONqcs-cli/1.0.0 linux-x64 node-v8.16.1USAGE$ qcs [COMMAND]COMMANDScancel Cancel reservations in the compute schedule.devices View available QPU devices.help display help for qcslattices View available lattices.reservations View the compute block schedule.reserve Book reservations in the compute schedule.
To use a command, simply type qcs
followed by the command:
$ qcs devicesDEVICEName: Aspen-8
To obtain more information about any command and possible flags type the command with --help flag
$ qcs devices --helpView available QPU devices.USAGE$ qcs devicesOPTIONS-f, --format=json|json-pretty|tabular [default: tabular] Data serialization format.-h, --help show CLI helpEXAMPLE$ qcs devices
From the example above you can see that qcs will often display display its output in a variety of formats including JSON. The default tabular format is intended to be easy to read on a terminal. For certain commands, using one of the JSON formats will provide you with more detailed information than is available through the tabular format. JSON output is designed to support integrating CLI output into scripts or programs.
To obtain a list of available Rigetti QPUs use the devices command:
$ qcs devicesDEVICEName: Aspen-8
If you use either --format=json
or --format-json-pretty
then you will see a JSON object containing additional information about each QPU that is available. It is beyond the scope of this document to describe the JSON format and that format is subject to change without notice.
To create a new reservation for QPU time, use the reserve command and follow the prompts. The following describes
$ qcs reserveAvailable credits: $5,000.00The next available compute block is:START END DURATION LATTICE PRICE2020-07-19 17:00 PDT 2020-07-19 17:15 PDT 15.00m Aspen-8 $0.00Accept? Type (y)es, (n)o to continue looking, or (q)uit: yBooking reservation(s)...Reservation(s) confirmed, run 'qcs reservations' to see the latest schedule.
If you type n
at the prompt asking to accept the next available block, you will be presented with a list of alternative reservations to choose from.
Flag | Action |
start | Specify a start time for the reservation (defalut is now). You can be fairly free form, but if you have spaces use quotes. e.g. "Friday at 5pm". |
duration | Duration of requested reservation. |
To obtain a list of pending reservations for your account, use the reservations
command.
$ qcs reservationsUPCOMING COMPUTE BLOCKSID START END DURATION LATTICE PRICE34857 2020-07-19 17:00 PDT 2020-07-19 17:15 PDT 15.00m Aspen-8 $0.00
To delete a pending reservation use the cancel
command. This is the same as deleting a reservation with the reserve --delete
command.
$ qcs cancel --id=34857UPCOMING COMPUTE BLOCKSID START END DURATION LATTICE PRICE34857 2020-07-19 17:00 PDT 2020-07-19 17:15 PDT 15.00m Aspen-8 $0.00Cancel reservation(s)? (y)es, (N)o: yReservation(s) cancelled. Type 'qcs reservations' to see the latest schedule.