qamuy command

You can use qamuy command after installing Qamuy Client SDK.

Check Qamuy Client SDK version

You can check the version with -V or --version option.

$ qamuy -V
Qamuy Client SDK, version *.**.*

Sub commands

qamuy command can be used with the following sub commands:

  • Account management

    • login, logout: Login to, logout from Qamuy

    • reset-password: Reset login password for Qamuy

  • Controlling calculation jobs

    • run: Run a computation job on Qamuy

    • status: Display status of a calculation job

    • result: Get result of a calculation job

    • terminate: Terminate a calculation job

    • list: Display a list of calculation jobs

Usage of the sub commands is described in the following sections.

Example: Login to Qamuy and execute a calculation

$ qamuy login
Email address: [Enter your registered email address]
Password: [Enter the password that was set]
$ qamuy run input.json

When the qamuy command is invoked with --help option, it displays usage description of the command. You can add --help option after a sub command to see usage of it.

$ qamuy --help
# Displays a brief description of common options and sub commands
$ qamuy run --help
# Displays a description of run sub command

Common options

The following options can be specified with any sub command. These common options should be specified between qamuy and the sub command.

Options

  • --silent (-s): Suppress messages other than warnings and errors

  • --debug (-d): Show detailed messages for debug

Example

# The followings are equivalent
$ qamuy --silent run input.json
$ qamuy -s run input.json

Account management

login: Login

Login to Qamuy with registered email address and password. You will be kept logged in on the terminal after the first login.

qamuy login [OPTIONS]

Options

  • --email-address (-e): Specifies the email address

  • --password: Specifies the password

Examples

Input email address and password interactively

$ qamuy login
Email address: [Enter your registered email address]
Password: [Enter the password that was set]

Specify email address and password via options (Be careful since the password may remain in command history)

$ qamuy login -e [registered email address] --password [password]

logout: Logout

Logout from Qamuy.

qamuy logout

Example

$ qamuy logout

reset-pasword: Reset password

You can send an email for resetting login password to a registered email address.

qamuy reset-password [OPTIONS]

Options

  • --email-address (-e): Specifies the email address

Examples

Input email address interactively

$ qamuy reset-password
Email address: [Enter your registered email address]

Specify email address via options

$ qamuy reset-password -e [registered email address]

Controlling jobs

You can controll jobs with the following sub commands.

run: Run a calculation job

Execute a calculation job on Qamuy. It waits for the calculation job to finish and then save or display the calculation result by default. If --submit-only option is specified, it exits without waiting for the calculation job to finish.

qamuy run [OPTIONS] INPUT

Arguments

  • INPUT: Specifies an input file for calculation. You can give either JSON or YAML file.

Options

  • --output (-o): Specifies a file to which the calculation result will be saved. The result is displayed in standard output when the option is not specified.

  • --output-format (-f): Specifies an output format in which the calculation result will be saved. You can specify either one of json or yaml. If not specified, YAML will be used when the output file name ends with .yaml or .yml, and JSON will be used otherwise.

  • --save-job (-j): Specifies a file to which job information (e.g. job ID) will be saved. The information will not be saved if not specified.

  • --submit-only: If specified, the command will immediately exit after starting the calculation job without waiting for the job to finish. If not specified, the command waits for the calculation job to finish and saves or displays the calculation result.

  • --fcidump: Specifies a fcidump file to generate Hamiltonian. If not specified, the calculation is run following the input file. Note: This is an experimental feature and may be subject to destructive changes.

Examples

Specify input.yaml as an input file and display the calculation result on standard output

$ qamuy run input.yaml
INFO     : Submitted a job
Job ID: JB01F7T0YJFJ78XC5NX350TKTMG9
Status: RUNNING
..

[Calculation result]

Save the calculation result to output.txt file in YAML format

$ qamuy run -o output.txt -f yaml input.yaml
INFO     : Submitted a job
Job ID: JB01F7T0YJFJ78XC5NX350TKTMG9
Status: RUNNING
..

INFO     : Successfully saved the output to output.txt

Save job information to job.json file and exits without waiting for the calculation job to finish

$ qamuy run -j job.json --submit-only input.yaml
INFO     : Submitted a job
Job ID: JB01F7T0YJFJ78XC5NX350TKTMG9
Status: RUNNING

status: Display status of a calculation job

Get and display status of a calculation job. You need to specify a job ID as an argument or a job information file with --job-file option.

qamuy status [OPTIONS] [JOB_ID]

Arguments

  • JOB_ID: Specifies a job ID

Options

  • --job-file (-j): Specifies a file from which job information will be read. You can specify a file saved with --save-job option of run sub command or save_job() function of Python SDK.

Examples

Display job status with a job ID specified

$ qamuy status JB01F7T0YJFJ78XC5NX350TKTMG9
Job ID: JB01F7T0YJFJ78XC5NX350TKTMG9
Status: SUCCESS

Display job status with a job information file specified

$ qamuy status -j job.json
Job ID: JB01F7T0YJFJ78XC5NX350TKTMG9
Status: SUCCESS

result: Get result of a calculation job

Get result of a calculation job and save or display it. You need to specify a job ID as an argument or a job information file with --job-file option. If the calculation job is still running, the command exits without waiting for the job to finish by default. If --wait-complete option is specified, the command waits for the job to finish and then get the result.

qamuy result [OPTIONS] [JOB_ID]

Arguments

  • JOB_ID: Specifies a job ID

Options

  • --job-file (-j): Specifies a file from which job information will be read. You can specify a file saved with --save-job option of run sub command or save_job() function of Python SDK.

  • --output (-o): Specifies a file to which the calculation result will be saved. The result is displayed in standard output when the option is not specified.

  • --output-format (-f): Specifies an output format in which the calculation result will be saved. You can specify either one of json or yaml. If not specified, YAML will be used when the output file name ends with .yaml or .yml, and JSON will be used otherwise.

  • --wait-complete (-w): If specified, the command waits for the job to finish and then get the result. If not specified, the command exits without getting the result if the job is still running.

Examples

Get the job result with a job ID specified (without waiting for job completion)

$ qamuy result JB01F7T0YJFJ78XC5NX350TKTMG9
[Calculation result]

Get the job result with a job information file specified and save it to output.txt file in YAML format (waiting for job completion)

$ qamuy result -j job.json -o output.txt -f yaml -w
..

INFO     : Successfully saved the output to output.txt

terminate: Terminate a calculation job

Terminate a running calculation job and display its status. If the job has already finished, either SUCCESS or FAILURE is displayed. You need to specify a job ID as an argument or a job information file with --job-file option.

qamuy terminate [OPTIONS] [JOB_ID]

Arguments

  • JOB_ID: Specifies a job ID

Options

  • --job-file (-j): Specifies a file from which job information will be read. You can specify a file saved with --save-job option of run sub command or save_job() function of Python SDK.

Examples

Terminate a job ID specified

$ qamuy terminate JB01F7T0YJFJ78XC5NX350TKTMG9
Job ID: JB01F7T0YJFJ78XC5NX350TKTMG9
Status: TERMINATED

Terminate a job with a job information file specified

$ qamuy terminate -j job.json
Job ID: JB01F7T0YJFJ78XC5NX350TKTMG9
Status: TERMINATED

list: Display a list of calculation jobs

Display a list of submitted calculation jobs. Information like job ID, job status, start time of the job and elapsed time can be obtained.

qamuy list [OPTIONS]

Options

  • --job-status: Specifies job status of displayed jobs. You can specify either one of the followings. All jobs are displayed if not specified.

    • RUNNING

    • SUCCESS

    • FAILURE

    • TERMINATED

Examples

Display all jobs

$ qamuy list
{
  "summary": [
    {
      "id": "JB01F9TNQJNFPJ54E3TS35EDPXWY",
      "status": "SUCCESS",
      "createdAt": "2021-07-05T06:29:48Z",
      "startedAt": "2021-07-05T06:30:01Z",
      "etime": "1h44m16s"
    },
    {
      "id": "JB01F9TVPXV2C6360BPQQP2AND4F",
      "status": "SUCCESS",
      "createdAt": "2021-07-05T08:14:18Z",
      "startedAt": "2021-07-05T08:14:23Z",
      "etime": "41m2s"
    }
  ]
}

Display all succeeded jobs

$ qamuy list --job-status SUCCESS
{
  "summary": [
    {
      "id": "JB01F9TNQJNFPJ54E3TS35EDPXWY",
      "status": "SUCCESS",
      "createdAt": "2021-07-05T06:29:48Z",
      "startedAt": "2021-07-05T06:30:01Z",
      "etime": "1h44m16s"
    },
    {
      "id": "JB01F9TVPXV2C6360BPQQP2AND4F",
      "status": "SUCCESS",
      "createdAt": "2021-07-05T08:14:18Z",
      "startedAt": "2021-07-05T08:14:23Z",
      "etime": "41m2s"
    }
  ]
}