Saving the Quantum Rings account locally
First, obtain the Quantum Rings Provider and then use the QuantumRingsLib.QuantumRingsProvider.save_account()
API to save your account locally. You can use the following code example.
import QuantumRingsLib
from QuantumRingsLib import QuantumRingsProvider
# Acquire the Quantum Rings Provider and your preferred backend
provider = QuantumRingsProvider(token =<YOUR_TOKEN_HERE>, name=<YOUR_ACCOUNT_NAME_HERE>)
backend = provider.get_backend("scarlet_quantum_rings")
print("Account Name: ", provider.active_account()["name"], "\nMax Qubits: ", provider.active_account()["max_qubits"])
# Save the account locally.
provider.save_account(token =<YOUR_TOKEN_HERE>, name=<YOUR_ACCOUNT_NAME_HERE>)
print(provider.saved_accounts(False, "default"))
You can also directly create the configuration file and store your credentials, by following these steps:
If you are a Linux or a macOS user
mkdir ~/.config/quantumrings
echo -e '[default]\nemail = <YOUR_ACCOUNT_ID>\nkey = <YOUR_ACCESS_KEY>\nbackend = scarlet_quantum_rings' > ~/.config/quantumrings/quantumrings.conf
If you are a Windows user
Create a folder
quantumrings
under%APPDATA%
. In that folder, create a file by namequantumrings.conf
and store the following contents using notepad in that file.