Authentication & Quotas

Quantinuum Nexus API usage requires you to have valid authentication tokens. You can obtain these by logging in with qnexus.

This isn’t required in the Nexus Lab, where authentication is automatically taken care of.

import qnexus as qnx

qnexus provides the following ways of logging in.

# Login with the browser
qnx.login()
# Login by passing your credentials
qnx.login_with_credentials()

You’ll now be authenticated and can use qnexus.

Please note that in order to collaborate on Projects with others, you’ll also need to have appropriate Role assignments set, see Teams & Roles

# Logout
qnx.logout()

Quotas

In addition to being authenticated, some operations in Nexus require you to have an appropriate Quota. These operations include:

  • using the Nexus Lab

  • compiling Circuits on Nexus

  • simulating Circuit execution on Nexus

  • storage of Project data in the Nexus Database

Your simulation, compilation and Nexus Lab quota will renew each month, but your database usage quota will not renew.

In addition, if you have access to Quantinuum H-series devices you’ll need to have a HQC quota.

# See your available quotas (including your usage)
qnx.quotas.get_all().df()
# Check if you have required quota or not
if qnx.quotas.check_quota(name="compilation"):
    print("Compilation quota OK!")
else:
    print("No more compilation quota!")