Skip to content

Commit

Permalink
Resolved merge conflict in quantum_experiments.ipynb and staged delet…
Browse files Browse the repository at this point in the history
…ed files
  • Loading branch information
PriyanshuKSharma committed Nov 25, 2024
2 parents 4c90575 + 570739f commit 2215354
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 1,079 deletions.
12 changes: 0 additions & 12 deletions Research Paper/quantum-cloud-integration.aux

This file was deleted.

121 changes: 0 additions & 121 deletions Research Paper/quantum-cloud-integration.fdb_latexmk

This file was deleted.

214 changes: 0 additions & 214 deletions Research Paper/quantum-cloud-integration.fls

This file was deleted.

462 changes: 0 additions & 462 deletions Research Paper/quantum-cloud-integration.log

This file was deleted.

Binary file removed Research Paper/quantum-cloud-integration.pdf
Binary file not shown.
Binary file removed Research Paper/quantum-cloud-integration.synctex.gz
Binary file not shown.
266 changes: 0 additions & 266 deletions Research Paper/quantum-cloud-integration.tex

This file was deleted.

Binary file removed images/quantum_vs_classical.png
Binary file not shown.
52 changes: 48 additions & 4 deletions notebooks/quantum_experiments.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"metadata": {},
"outputs": [
{
<<<<<<< HEAD
"ename": "ModuleNotFoundError",
"evalue": "No module named 'qiskit.providers.aer'",
"output_type": "error",
Expand All @@ -14,6 +15,17 @@
"\u001b[1;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[1;32mIn[1], line 4\u001b[0m\n\u001b[0;32m 2\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mqiskit\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m QuantumCircuit\n\u001b[0;32m 3\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mqiskit\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mvisualization\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m plot_histogram\n\u001b[1;32m----> 4\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mqiskit\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mproviders\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01maer\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m Aer \u001b[38;5;66;03m# Corrected import\u001b[39;00m\n\u001b[0;32m 5\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mqiskit\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m execute\n\u001b[0;32m 6\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mmatplotlib\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mpyplot\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m \u001b[38;5;21;01mplt\u001b[39;00m\n",
"\u001b[1;31mModuleNotFoundError\u001b[0m: No module named 'qiskit.providers.aer'"
=======
"ename": "ImportError",
"evalue": "Qiskit is installed in an invalid environment that has both Qiskit >=1.0 and an earlier version. You should create a new virtual environment, and ensure that you do not mix dependencies between Qiskit <1.0 and >=1.0. Any packages that depend on 'qiskit-terra' are not compatible with Qiskit 1.0 and will need to be updated. Qiskit unfortunately cannot enforce this requirement during environment resolution. See https://qisk.it/packaging-1-0 for more detail.",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mImportError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[1], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;66;03m# Install and upgrade qiskit package\u001b[39;00m\n\u001b[0;32m----> 2\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mqiskit\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m QuantumCircuit\n\u001b[1;32m 3\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mqiskit\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mvisualization\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m plot_histogram\n\u001b[1;32m 4\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mqiskit\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mproviders\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01maer\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m Aer \u001b[38;5;66;03m# Corrected import\u001b[39;00m\n",
"File \u001b[0;32m~/.local/lib/python3.11/site-packages/qiskit/__init__.py:38\u001b[0m\n\u001b[1;32m 36\u001b[0m _suppress_error \u001b[38;5;241m=\u001b[39m os\u001b[38;5;241m.\u001b[39menviron\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mQISKIT_SUPPRESS_1_0_IMPORT_ERROR\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;28;01mFalse\u001b[39;00m) \u001b[38;5;241m==\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m1\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 37\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mint\u001b[39m(_major) \u001b[38;5;241m>\u001b[39m \u001b[38;5;241m0\u001b[39m \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m _suppress_error:\n\u001b[0;32m---> 38\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mImportError\u001b[39;00m(\n\u001b[1;32m 39\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mQiskit is installed in an invalid environment that has both Qiskit >=1.0\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 40\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m and an earlier version.\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 41\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m You should create a new virtual environment, and ensure that you do not mix\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 42\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m dependencies between Qiskit <1.0 and >=1.0.\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 43\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m Any packages that depend on \u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mqiskit-terra\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m are not compatible with Qiskit 1.0 and\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 44\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m will need to be updated.\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 45\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m Qiskit unfortunately cannot enforce this requirement during environment resolution.\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 46\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m See https://qisk.it/packaging-1-0 for more detail.\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 47\u001b[0m )\n\u001b[1;32m 49\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mqiskit\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01m_accelerate\u001b[39;00m\n\u001b[1;32m 50\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mqiskit\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01m_numpy_compat\u001b[39;00m\n",
"\u001b[0;31mImportError\u001b[0m: Qiskit is installed in an invalid environment that has both Qiskit >=1.0 and an earlier version. You should create a new virtual environment, and ensure that you do not mix dependencies between Qiskit <1.0 and >=1.0. Any packages that depend on 'qiskit-terra' are not compatible with Qiskit 1.0 and will need to be updated. Qiskit unfortunately cannot enforce this requirement during environment resolution. See https://qisk.it/packaging-1-0 for more detail."
>>>>>>> 570739f56d23f98e9186908b7280696d9db7a1ff
]
}
],
Expand Down Expand Up @@ -45,10 +57,42 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {},
<<<<<<< HEAD
"outputs": [],
"source": []
=======
"outputs": [
{
"ename": "NameError",
"evalue": "name 'QuantumCircuit' is not defined",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[2], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;66;03m# Create a quantum circuit\u001b[39;00m\n\u001b[0;32m----> 2\u001b[0m qc \u001b[38;5;241m=\u001b[39m \u001b[43mQuantumCircuit\u001b[49m(\u001b[38;5;241m2\u001b[39m, \u001b[38;5;241m2\u001b[39m)\n\u001b[1;32m 3\u001b[0m qc\u001b[38;5;241m.\u001b[39mh(\u001b[38;5;241m0\u001b[39m)\n\u001b[1;32m 4\u001b[0m qc\u001b[38;5;241m.\u001b[39mcx(\u001b[38;5;241m0\u001b[39m, \u001b[38;5;241m1\u001b[39m)\n",
"\u001b[0;31mNameError\u001b[0m: name 'QuantumCircuit' is not defined"
]
}
],
"source": [
"# Create a quantum circuit\n",
"qc = QuantumCircuit(2, 2)\n",
"qc.h(0)\n",
"qc.cx(0, 1)\n",
"qc.measure([0, 1], [0, 1])\n",
"\n",
"# Simulate and visualize the result\n",
"simulator = Aer.get_backend('qasm_simulator')\n",
"job = execute(qc, simulator, shots=1024)\n",
"result = job.result()\n",
"\n",
"counts = result.get_counts(qc)\n",
"print(counts)\n",
"plot_histogram(counts)"
]
>>>>>>> 570739f56d23f98e9186908b7280696d9db7a1ff
},
{
"cell_type": "code",
Expand Down Expand Up @@ -102,7 +146,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -116,9 +160,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
"version": "3.11.9"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}

0 comments on commit 2215354

Please # to comment.