Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 55 additions & 11 deletions algorithms/bernstein_vazirani/bernstein_vazirani.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,14 @@
"cell_type": "code",
"execution_count": 1,
"id": "1de041eb-4f59-48c0-a181-6858b330e627",
"metadata": {},
"metadata": {
"execution": {
"iopub.execute_input": "2025-03-27T12:45:39.144369Z",
"iopub.status.busy": "2025-03-27T12:45:39.143984Z",
"iopub.status.idle": "2025-03-27T12:45:41.065437Z",
"shell.execute_reply": "2025-03-27T12:45:41.064937Z"
}
},
"outputs": [],
"source": [
"from classiq import *\n",
Expand Down Expand Up @@ -143,7 +150,14 @@
"cell_type": "code",
"execution_count": 2,
"id": "c6940ec0-8342-4fba-b827-46f3883b3ac3",
"metadata": {},
"metadata": {
"execution": {
"iopub.execute_input": "2025-03-27T12:45:41.067528Z",
"iopub.status.busy": "2025-03-27T12:45:41.067275Z",
"iopub.status.idle": "2025-03-27T12:45:41.070708Z",
"shell.execute_reply": "2025-03-27T12:45:41.070174Z"
}
},
"outputs": [],
"source": [
"@qfunc\n",
Expand Down Expand Up @@ -174,7 +188,14 @@
"cell_type": "code",
"execution_count": 3,
"id": "31536bc7-2fb8-4ad8-84fe-4f5b99d812aa",
"metadata": {},
"metadata": {
"execution": {
"iopub.execute_input": "2025-03-27T12:45:41.072494Z",
"iopub.status.busy": "2025-03-27T12:45:41.072271Z",
"iopub.status.idle": "2025-03-27T12:45:44.949002Z",
"shell.execute_reply": "2025-03-27T12:45:44.948284Z"
}
},
"outputs": [],
"source": [
"import numpy as np\n",
Expand Down Expand Up @@ -213,14 +234,23 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 4,
"id": "5aed0709-6746-4e30-9237-e01444d2cb43",
"metadata": {},
"metadata": {
"execution": {
"iopub.execute_input": "2025-03-27T12:45:44.953324Z",
"iopub.status.busy": "2025-03-27T12:45:44.952802Z",
"iopub.status.idle": "2025-03-27T12:45:46.309812Z",
"shell.execute_reply": "2025-03-27T12:45:46.308951Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": []
"text": [
"Opening: https://platform.classiq.io/circuit/2utt9QW8hOOSd277vGPr1rT1i3Z?login=True&version=0.73.0\n"
]
}
],
"source": [
Expand All @@ -237,25 +267,39 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 5,
"id": "adb27aa5-17e8-47c0-a1c5-5851c4d9aa40",
"metadata": {},
"metadata": {
"execution": {
"iopub.execute_input": "2025-03-27T12:45:46.312398Z",
"iopub.status.busy": "2025-03-27T12:45:46.312128Z",
"iopub.status.idle": "2025-03-27T12:45:49.669180Z",
"shell.execute_reply": "2025-03-27T12:45:49.667225Z"
}
},
"outputs": [],
"source": [
"result = execute(qprog).result_value()"
]
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 6,
"id": "56db1ac8-6cc1-45a9-a97b-ab00c3138842",
"metadata": {},
"metadata": {
"execution": {
"iopub.execute_input": "2025-03-27T12:45:49.674391Z",
"iopub.status.busy": "2025-03-27T12:45:49.674127Z",
"iopub.status.idle": "2025-03-27T12:45:49.682709Z",
"shell.execute_reply": "2025-03-27T12:45:49.680958Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The secret integer is: 13.0\n",
"The secret integer is: 13\n",
"The probability for measuring the secret integer is: 1.0\n"
]
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,44 @@
{}
{
"constraints": {
"max_gate_count": {},
"optimization_parameter": "no_opt"
},
"preferences": {
"machine_precision": 8,
"custom_hardware_settings": {
"basis_gates": [
"sxdg",
"h",
"y",
"cz",
"z",
"id",
"cx",
"cy",
"rx",
"r",
"sdg",
"tdg",
"x",
"rz",
"s",
"u2",
"u",
"u1",
"t",
"sx",
"p",
"ry"
],
"is_symmetric_connectivity": true
},
"debug_mode": true,
"synthesize_all_separately": false,
"optimization_level": 3,
"output_format": ["qasm"],
"pretty_qasm": true,
"transpilation_option": "auto optimize",
"timeout_seconds": 300,
"random_seed": 1300569423
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,12 @@
"ExecuteTime": {
"end_time": "2024-09-22T09:08:38.849896Z",
"start_time": "2024-09-22T09:08:38.846242Z"
},
"execution": {
"iopub.execute_input": "2025-03-27T12:45:39.146630Z",
"iopub.status.busy": "2025-03-27T12:45:39.146032Z",
"iopub.status.idle": "2025-03-27T12:45:41.034157Z",
"shell.execute_reply": "2025-03-27T12:45:41.033436Z"
}
},
"outputs": [],
Expand Down Expand Up @@ -203,6 +209,12 @@
"ExecuteTime": {
"end_time": "2024-09-22T09:08:38.862494Z",
"start_time": "2024-09-22T09:08:38.859032Z"
},
"execution": {
"iopub.execute_input": "2025-03-27T12:45:41.036983Z",
"iopub.status.busy": "2025-03-27T12:45:41.036561Z",
"iopub.status.idle": "2025-03-27T12:45:41.040385Z",
"shell.execute_reply": "2025-03-27T12:45:41.039931Z"
}
},
"outputs": [],
Expand Down Expand Up @@ -301,6 +313,12 @@
"ExecuteTime": {
"end_time": "2024-09-22T09:08:38.875497Z",
"start_time": "2024-09-22T09:08:38.872985Z"
},
"execution": {
"iopub.execute_input": "2025-03-27T12:45:41.042571Z",
"iopub.status.busy": "2025-03-27T12:45:41.042434Z",
"iopub.status.idle": "2025-03-27T12:45:41.044961Z",
"shell.execute_reply": "2025-03-27T12:45:41.044563Z"
}
},
"outputs": [],
Expand Down Expand Up @@ -343,6 +361,12 @@
"ExecuteTime": {
"end_time": "2024-09-22T09:08:38.885791Z",
"start_time": "2024-09-22T09:08:38.883658Z"
},
"execution": {
"iopub.execute_input": "2025-03-27T12:45:41.047086Z",
"iopub.status.busy": "2025-03-27T12:45:41.046950Z",
"iopub.status.idle": "2025-03-27T12:45:41.049415Z",
"shell.execute_reply": "2025-03-27T12:45:41.049021Z"
}
},
"outputs": [],
Expand Down Expand Up @@ -370,6 +394,12 @@
"ExecuteTime": {
"end_time": "2024-09-22T09:08:38.894351Z",
"start_time": "2024-09-22T09:08:38.892743Z"
},
"execution": {
"iopub.execute_input": "2025-03-27T12:45:41.051318Z",
"iopub.status.busy": "2025-03-27T12:45:41.051184Z",
"iopub.status.idle": "2025-03-27T12:45:41.053373Z",
"shell.execute_reply": "2025-03-27T12:45:41.052984Z"
}
},
"outputs": [],
Expand All @@ -394,6 +424,12 @@
"ExecuteTime": {
"end_time": "2024-09-22T09:08:38.902741Z",
"start_time": "2024-09-22T09:08:38.900967Z"
},
"execution": {
"iopub.execute_input": "2025-03-27T12:45:41.055287Z",
"iopub.status.busy": "2025-03-27T12:45:41.055154Z",
"iopub.status.idle": "2025-03-27T12:45:41.057447Z",
"shell.execute_reply": "2025-03-27T12:45:41.057073Z"
}
},
"outputs": [],
Expand All @@ -420,14 +456,20 @@
"ExecuteTime": {
"end_time": "2024-09-22T09:08:43.826480Z",
"start_time": "2024-09-22T09:08:38.908926Z"
},
"execution": {
"iopub.execute_input": "2025-03-27T12:45:41.059403Z",
"iopub.status.busy": "2025-03-27T12:45:41.059268Z",
"iopub.status.idle": "2025-03-27T12:45:46.364124Z",
"shell.execute_reply": "2025-03-27T12:45:46.363262Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Opening: https://platform.classiq.io/circuit/2tw90OEn6GrybiwQeFdaqWvPil5?login=True&version=0.70.0\n"
"Opening: https://platform.classiq.io/circuit/2utt9WsDOIP6kdUNtlNRMW39MRo?login=True&version=0.73.0\n"
]
}
],
Expand Down Expand Up @@ -478,6 +520,12 @@
"ExecuteTime": {
"end_time": "2024-09-22T09:08:50.398532Z",
"start_time": "2024-09-22T09:08:46.048683Z"
},
"execution": {
"iopub.execute_input": "2025-03-27T12:45:46.366274Z",
"iopub.status.busy": "2025-03-27T12:45:46.365922Z",
"iopub.status.idle": "2025-03-27T12:45:49.673800Z",
"shell.execute_reply": "2025-03-27T12:45:49.672572Z"
}
},
"outputs": [
Expand Down Expand Up @@ -538,6 +586,12 @@
"ExecuteTime": {
"end_time": "2024-09-22T09:08:50.586610Z",
"start_time": "2024-09-22T09:08:50.416959Z"
},
"execution": {
"iopub.execute_input": "2025-03-27T12:45:49.676976Z",
"iopub.status.busy": "2025-03-27T12:45:49.676760Z",
"iopub.status.idle": "2025-03-27T12:45:49.895215Z",
"shell.execute_reply": "2025-03-27T12:45:49.894440Z"
}
},
"outputs": [],
Expand Down Expand Up @@ -621,6 +675,12 @@
"ExecuteTime": {
"end_time": "2024-09-22T09:08:56.773264Z",
"start_time": "2024-09-22T09:08:50.597099Z"
},
"execution": {
"iopub.execute_input": "2025-03-27T12:45:49.897770Z",
"iopub.status.busy": "2025-03-27T12:45:49.897493Z",
"iopub.status.idle": "2025-03-27T12:45:54.594934Z",
"shell.execute_reply": "2025-03-27T12:45:54.594570Z"
}
},
"outputs": [],
Expand Down Expand Up @@ -712,7 +772,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.9"
"version": "3.11.7"
},
"vscode": {
"interpreter": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,44 @@
{}
{
"constraints": {
"max_gate_count": {},
"optimization_parameter": "no_opt"
},
"preferences": {
"machine_precision": 8,
"custom_hardware_settings": {
"basis_gates": [
"p",
"z",
"x",
"h",
"id",
"cx",
"u",
"ry",
"cy",
"rx",
"y",
"cz",
"sdg",
"rz",
"t",
"r",
"sxdg",
"tdg",
"s",
"u2",
"u1",
"sx"
],
"is_symmetric_connectivity": true
},
"debug_mode": true,
"synthesize_all_separately": false,
"optimization_level": 3,
"output_format": ["qasm"],
"pretty_qasm": true,
"transpilation_option": "auto optimize",
"timeout_seconds": 300,
"random_seed": 1675572118
}
}