Skip to content

Commit

Permalink
fix: add dummy change to trigger push tests
Browse files Browse the repository at this point in the history
  • Loading branch information
daka1510 committed Dec 1, 2021
1 parent 900fe91 commit 7a15dd6
Show file tree
Hide file tree
Showing 2 changed files with 246 additions and 1 deletion.
245 changes: 245 additions & 0 deletions Untitled.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,245 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "8aa52e7f",
"metadata": {},
"outputs": [],
"source": [
"from logging import getLogger, DEBUG\n",
"from qiskit import QuantumCircuit\n",
"from qiskit_ibm_runtime import IBMRuntimeService"
]
},
{
"cell_type": "markdown",
"id": "2bf0da64",
"metadata": {},
"source": [
"### Enable Logging"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "27e4d2f6",
"metadata": {},
"outputs": [],
"source": [
"getLogger('qiskit_ibm_runtime.ibm_runtime_service').setLevel(DEBUG)"
]
},
{
"cell_type": "markdown",
"id": "25342757",
"metadata": {},
"source": [
"### Set Credentials"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "6b8c36d2",
"metadata": {},
"outputs": [],
"source": [
"def get_auth(id: str = \"iqx-production\") -> str:\n",
" if id == \"iqx-production\":\n",
" token = \"b04ac62bc044eff31f7a47ef245cb0b7cb9c3b5dc0110c0414136d3a421e74f714be20213cf08f4867d5a4d53746855e5f4c63b7c0f17b7687cab57d38a91972\"\n",
" url = \"https://auth.quantum-computing.ibm.com/api\"\n",
" elif id == \"iqx-staging\":\n",
" token = \"d78b5e7314e0181a61318e35754a9e14816d2d59e586edb430f2117f71c95226043b53f293cdaf8065f21dfe388794bb29ca013d1ee03b4406f53ad7202a40bd\"\n",
" url = \"https://auth-dev.quantum-computing.ibm.com/api\"\n",
" elif id == \"cloud\":\n",
" token = \"\"\n",
" url = \"https://www-dev.quantum-computing.ibm.com/api\"\n",
" else:\n",
" raise Exception(\"Unknown auth identifier.\")\n",
" \n",
" return token, url"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "4a5103d5",
"metadata": {},
"outputs": [],
"source": [
"# ! curl --location --request GET 'https://us-east.quantum-computing.cloud.ibm.com/programs' --header 'Service-CRN: crn:v1:bluemix:public:quantum-computing:us-east:a/41d9bde3ef128894870dfbeaca4a5260:0ddc92a3-00be-4ec8-987e-cafda1b086fb::' --header 'Authorization: apikey nqLGlJz-6RKkdoa2SZt-Er_XDAtqEuiy1nyKV3jiU8sq'"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "f5687043",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "351357c8",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 8,
"id": "18ef88e6",
"metadata": {},
"outputs": [],
"source": [
"token, url = get_auth(id=\"iqx-staging\")"
]
},
{
"cell_type": "markdown",
"id": "be12a709",
"metadata": {},
"source": [
"### Initiate Runtime Service"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "dcb58e6a",
"metadata": {},
"outputs": [],
"source": [
"IBMRuntimeService.save_account(token=\"123\", overwrite=True)\n",
"IBMRuntimeService.save_account(token=\"123\", hub=\"hub\", group=\"group\", project=\"project\", overwrite=True)"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "82b999eb",
"metadata": {},
"outputs": [],
"source": [
"service = IBMRuntimeService(token=token, url=url)"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "3fe1423f",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"==================================================\n",
"sample-expval:\n",
" Name: sample-expval\n",
" Description: A sample expectation value program.\n",
"==================================================\n",
"sampler:\n",
" Name: sampler\n",
" Description: Sample distributions generated by given circuits executed on the target backend.\n",
"==================================================\n",
"qasm3-runner:\n",
" Name: qasm3-runner\n",
" Description: A runtime program that takes one or more circuits, converts them to OpenQASM3, compiles them, executes them, and optionally applies measurement error mitigation. This program can also take and execute one or more OpenQASM3 strings. Note that this program can only run on a backend that supports OpenQASM3.\n",
"==================================================\n",
"runtime-simple-kb3k04L6jb:\n",
" Name: runtime-simple\n",
" Description: Simple runtime program used for testing.\n",
"==================================================\n",
"sample-program-B2pLAgRXq2:\n",
" Name: sample-program\n",
" Description: A sample runtime program.\n",
"==================================================\n",
"estimator:\n",
" Name: estimator\n",
" Description: Expectation value estimator. A runtime program that estimates the value of an observable for an input quantum circuit. This program is in beta mode and is only available to select accounts.\n",
"==================================================\n",
"circuit-runner-qasm3:\n",
" Name: circuit-runner-qasm3\n",
" Description: A runtime program that takes one or more circuits or qasm3 string, compiles them, executes them, and optionally applies measurement error mitigation.\n",
"==================================================\n",
"vqe:\n",
" Name: vqe\n",
" Description: Variational Quantum Eigensolver (VQE) to find the minimal eigenvalue of a Hamiltonian.\n",
"==================================================\n",
"vqe-t18:\n",
" Name: vqe-t18\n",
" Description: Variational Quantum Eigensolver (VQE) to find the minimal eigenvalue of a Hamiltonian.\n",
"==================================================\n",
"sample-program:\n",
" Name: sample-program\n",
" Description: A sample runtime program.\n",
"==================================================\n",
"circuit-runner:\n",
" Name: circuit-runner\n",
" Description: A runtime program that takes one or more circuits, compiles them, executes them, and optionally applies measurement error mitigation.\n",
"==================================================\n",
"quantum-kernel-alignment:\n",
" Name: quantum-kernel-alignment\n",
" Description: Quantum kernel alignment algorithm that learns, on a given dataset, a quantum kernel maximizing the SVM classification margin.\n"
]
}
],
"source": [
"service.pprint_programs()"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "9d73141a",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{}"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"service.saved_account()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "9d29f2a2",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.4"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
2 changes: 1 addition & 1 deletion qiskit_ibm_runtime/ibm_runtime_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def __init__(
If there is no default value, and both accounts were saved on disk, the cloud type is
used.
token: Token used for authentication. If not specified, the saved token is used.
locator: The authentication url, if `auth=legacy`. Otherwise the CRN.
locator: The authentication url, if `auth=legacy`. Otherwise, the CRN.
**kwargs: Additional settings for the connection:
* proxies (dict): proxy configuration.
Expand Down

0 comments on commit 7a15dd6

Please sign in to comment.