Skip to content

Commit bb5ec14

Browse files
authored
always display json body for colab error (#34)
1 parent 834b54d commit bb5ec14

2 files changed

Lines changed: 34 additions & 33 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ To set up, follow the instructions below:
1313
Use `export` to set the IonQ API key as an environment variable:
1414

1515
```shell
16-
export IONQ_API_KEY=api_key_here # Windows: set IONQ_API_KEY=api_key_here
16+
export IONQ_API_KEY=api_key_here # Windows: set IONQ_API_KEY=api_key_here
1717
```
1818

1919
3. Install the required [Python libraries](requirements.txt).

curl/main.ipynb

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -49,45 +49,46 @@
4949
"cell_type": "code",
5050
"execution_count": 3,
5151
"metadata": {},
52-
"outputs": [
53-
{
54-
"name": "stdout",
55-
"output_type": "stream",
56-
"text": [
57-
"{\n",
58-
" \"shots\": 100,\n",
59-
" \"target\": \"simulator\",\n",
60-
" \"input\": {\n",
61-
" \"format\": \"ionq.circuit.v0\",\n",
62-
" \"gateset\": \"qis\",\n",
63-
" \"qubits\": 2,\n",
64-
" \"circuit\": [\n",
65-
" {\n",
66-
" \"gate\": \"h\",\n",
67-
" \"target\": 0\n",
68-
" },\n",
69-
" {\n",
70-
" \"gate\": \"cnot\",\n",
71-
" \"control\": 0,\n",
72-
" \"target\": 1\n",
73-
" }\n",
74-
" ]\n",
75-
" }\n",
76-
"}\n"
77-
]
78-
}
79-
],
52+
"outputs": [],
8053
"source": [
81-
"with open(\"data.json\", \"r\") as file:\n",
82-
" data = json.load(file)\n",
83-
"\n",
8454
"headers = {\n",
8555
" \"Authorization\": f\"apiKey {api_key}\",\n",
8656
" \"Content-Type\": \"application/json\",\n",
8757
" \"User-Agent\": f\"python-requests/{requests.__version__}\"\n",
8858
"}\n",
8959
"\n",
90-
"print(json.dumps(data, indent=4))"
60+
"with open(\"data.json\", \"r\") as f:\n",
61+
" data = json.load(f)\n",
62+
"\n",
63+
"# print(json.dumps(data, indent=4))"
64+
]
65+
},
66+
{
67+
"cell_type": "markdown",
68+
"metadata": {},
69+
"source": [
70+
"```json\n",
71+
"{\n",
72+
" \"shots\": 100,\n",
73+
" \"target\": \"simulator\",\n",
74+
" \"input\": {\n",
75+
" \"format\": \"ionq.circuit.v0\",\n",
76+
" \"gateset\": \"qis\",\n",
77+
" \"qubits\": 2,\n",
78+
" \"circuit\": [\n",
79+
" {\n",
80+
" \"gate\": \"h\",\n",
81+
" \"target\": 0\n",
82+
" },\n",
83+
" {\n",
84+
" \"gate\": \"cnot\",\n",
85+
" \"control\": 0,\n",
86+
" \"target\": 1\n",
87+
" }\n",
88+
" ]\n",
89+
" }\n",
90+
"}\n",
91+
"```"
9192
]
9293
},
9394
{

0 commit comments

Comments
 (0)