Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,28 @@
"preferences": {
"custom_hardware_settings": {
"basis_gates": [
"tdg",
"u1",
"id",
"x",
"rz",
"h",
"r",
"y",
"ry",
"u",
"cz",
"cx",
"u",
"s",
"t",
"sx",
"z",
"y",
"id",
"cz",
"cy",
"s",
"tdg",
"r",
"p",
"x",
"sdg",
"u1",
"h",
"rx",
"u2",
"z",
"sxdg",
"sx",
"rx"
"sxdg"
],
"is_symmetric_connectivity": true
},
Expand All @@ -36,7 +36,7 @@
"optimization_level": 0,
"output_format": ["qasm"],
"pretty_qasm": true,
"random_seed": 1095822036,
"random_seed": 2436614125,
"synthesize_all_separately": false,
"timeout_seconds": 14400,
"transpilation_option": "none"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Quantum program link: https://platform.classiq.io/circuit/35Ymmdx4Nd4yMDLkrEFuj3x5jfq\n"
"Quantum program link: https://platform.classiq.io/circuit/36Kv3IHzCrF6u4tlpAq5B1HR8Si\n"
]
}
],
Expand Down Expand Up @@ -800,7 +800,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Quantum program link: https://platform.classiq.io/circuit/35YmvV3AiErG6tre2cgDPt1W8eT\n"
"Quantum program link: https://platform.classiq.io/circuit/36KvCqUGkELsrxHNs9Qxdqc4oeP\n"
]
}
],
Expand Down Expand Up @@ -854,7 +854,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"QSVT solution: [2.02991919 3.19791738 0.90593325 2.02250168]\n",
"QSVT solution: [1.57739789 2.77684905 0.27102853 0.84553989]\n",
"Classical solution: [1.60481928 2.84578313 0.25179803 0.90240044]\n"
]
}
Expand Down Expand Up @@ -1274,7 +1274,7 @@
" )\n",
"\n",
"\n",
"@qfunc\n",
"@qperm\n",
"def phase_application(qae_phase: Const[QArray], gamma: CReal):\n",
" phase(\n",
" get_func_polynomial_expression(func, 1.0, n_phase_qubits, qae_phase),\n",
Expand All @@ -1287,9 +1287,9 @@
" magnitudes_list: list[list[float]],\n",
" phases_list: list[list[float]],\n",
" qae_phase: QArray,\n",
" reg: QNum,\n",
" reg: Const[QNum],\n",
" dummy_data: Output[QBit],\n",
"):\n",
" dummy_data = QBit()\n",
" full_qae = QArray()\n",
" allocate(dummy_data)\n",
" bind([qae_phase, dummy_data], full_qae)\n",
Expand All @@ -1305,9 +1305,10 @@
"\n",
"@qfunc\n",
"def dummy_cost_layer(qae_phase: QArray, reg: QArray, gamma: CReal) -> None:\n",
" dummy_data = QBit()\n",
" within_apply(\n",
" lambda: dummy_qae(\n",
" qae_amplitudes_magnitudes, qae_amplitudes_phases, qae_phase, reg\n",
" qae_amplitudes_magnitudes, qae_amplitudes_phases, qae_phase, reg, dummy_data\n",
" ),\n",
" lambda: phase_application(qae_phase, gamma),\n",
" )\n",
Expand All @@ -1325,7 +1326,8 @@
" allocate(n_phase_qubits, qae_phase)\n",
" hadamard_transform(reg)\n",
" for i in range(gammas.len):\n",
" qaoa_layer(qae_phase, reg, gammas[i], betas[i])"
" qaoa_layer(qae_phase, reg, gammas[i], betas[i])\n",
" drop(qae_phase)"
]
},
{
Expand All @@ -1338,7 +1340,7 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 24,
"id": "36",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -1368,7 +1370,7 @@
},
{
"cell_type": "code",
"execution_count": 24,
"execution_count": 25,
"id": "37",
"metadata": {},
"outputs": [
Expand All @@ -1377,7 +1379,7 @@
"output_type": "stream",
"text": [
"Polynomial Expression: 0.0980171403295606*x0\n",
"Quantum program link: https://platform.classiq.io/circuit/35Yp2wiJAN939cSLF2kJ7ikW9ek\n"
"Quantum program link: https://platform.classiq.io/circuit/36KvrBu70NXAUMj1I3QbOtV1zgM\n"
]
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ qfunc inplace_prepare_complex_amplitudes_expanded___2(magnitudes: real[], target
}

@disable_perm_check
qperm dummy_qae_expanded___0(qae_phase: qbit[1], reg: qnum<6, False, 0>) {
dummy_data: qbit;
qperm dummy_qae_expanded___0(qae_phase: qbit[1], const reg: qnum<6, False, 0>, output dummy_data: qbit) {
full_qae: qbit[2];
allocate(1, dummy_data);
{qae_phase, dummy_data} -> full_qae;
Expand Down Expand Up @@ -554,13 +553,14 @@ qperm dummy_qae_expanded___0(qae_phase: qbit[1], reg: qnum<6, False, 0>) {
full_qae -> {qae_phase, dummy_data};
}

qfunc phase_application_expanded___0(const qae_phase: qbit[1], gamma: real) {
qperm phase_application_expanded___0(const qae_phase: qbit[1], gamma: real) {
phase (0.049 - (0.049 * qae_phase[0]), gamma);
}

qfunc dummy_cost_layer_expanded___0(qae_phase: qbit[1], reg: qbit[6], gamma: real) {
dummy_data: qbit;
within {
dummy_qae_expanded___0(qae_phase, reg);
dummy_qae_expanded___0(qae_phase, reg, dummy_data);
} apply {
phase_application_expanded___0(qae_phase, gamma);
}
Expand All @@ -582,6 +582,7 @@ qfunc qaoa_circuit_expanded___0(gammas: real[1], betas: real[1], reg: qbit[6]) {
allocate(1, qae_phase);
hadamard_transform_expanded___0(reg);
qaoa_layer_expanded___0(qae_phase, reg, gammas[0], betas[0]);
drop(qae_phase);
}

qfunc main(gammas: real[1], betas: real[1], output reg: qbit[6]) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,28 @@
"preferences": {
"custom_hardware_settings": {
"basis_gates": [
"tdg",
"u1",
"id",
"x",
"rz",
"h",
"r",
"y",
"ry",
"u",
"cz",
"cx",
"u",
"s",
"t",
"sx",
"z",
"y",
"id",
"cz",
"cy",
"s",
"tdg",
"r",
"p",
"x",
"sdg",
"u1",
"h",
"rx",
"u2",
"z",
"sxdg",
"sx",
"rx"
"sxdg"
],
"is_symmetric_connectivity": true
},
Expand All @@ -36,7 +36,7 @@
"optimization_level": 1,
"output_format": ["qasm"],
"pretty_qasm": true,
"random_seed": 2847864142,
"random_seed": 1135456536,
"synthesize_all_separately": false,
"timeout_seconds": 14400,
"transpilation_option": "none"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,28 @@
"preferences": {
"custom_hardware_settings": {
"basis_gates": [
"tdg",
"u1",
"id",
"x",
"rz",
"h",
"r",
"y",
"ry",
"u",
"cz",
"cx",
"u",
"s",
"t",
"sx",
"z",
"y",
"id",
"cz",
"cy",
"s",
"tdg",
"r",
"p",
"x",
"sdg",
"u1",
"h",
"rx",
"u2",
"z",
"sxdg",
"sx",
"rx"
"sxdg"
],
"is_symmetric_connectivity": true
},
Expand All @@ -36,7 +36,7 @@
"optimization_level": 1,
"output_format": ["qasm"],
"pretty_qasm": true,
"random_seed": 1685164119,
"random_seed": 661480079,
"synthesize_all_separately": false,
"timeout_seconds": 14400,
"transpilation_option": "none"
Expand Down