{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "a866359da8df0489",
   "metadata": {},
   "source": [
    "# Quickstart"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ef302dc8f33466e4",
   "metadata": {},
   "outputs": [],
   "source": [
    "from mqt.bench import CompilerSettings, QiskitSettings, TKETSettings, get_benchmark"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ee984ededf8e10bc",
   "metadata": {},
   "source": [
    "### Algorithmic Level"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "8346993b51294feb",
   "metadata": {},
   "outputs": [],
   "source": [
    "qc_algorithmic_level = get_benchmark(benchmark_name=\"dj\", level=\"alg\", circuit_size=5)\n",
    "qc_algorithmic_level.draw(output=\"mpl\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3edc74a2bf18d67d",
   "metadata": {},
   "source": [
    "### Target-independent Level"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "9482737dacfc40d",
   "metadata": {},
   "outputs": [],
   "source": [
    "qc_target_independent_level = get_benchmark(benchmark_name=\"dj\", level=\"indep\", circuit_size=5, compiler=\"qiskit\")\n",
    "qc_target_independent_level.draw(output=\"mpl\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f3c0ae43336dca9b",
   "metadata": {},
   "source": [
    "### Target-dependent Native Gates Level"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ca5ce053798f36e5",
   "metadata": {},
   "outputs": [],
   "source": [
    "compiler_settings = CompilerSettings(qiskit=QiskitSettings(optimization_level=2))\n",
    "qc_native_gates_level = get_benchmark(\n",
    "    benchmark_name=\"dj\",\n",
    "    level=\"nativegates\",\n",
    "    circuit_size=5,\n",
    "    compiler=\"qiskit\",\n",
    "    compiler_settings=compiler_settings,\n",
    "    provider_name=\"ionq\",\n",
    ")\n",
    "qc_native_gates_level.draw(output=\"mpl\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d57921d7884bb4cc",
   "metadata": {},
   "source": [
    "### Target-dependent Mapped Level"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ddb7b07a146a8fd8",
   "metadata": {},
   "outputs": [],
   "source": [
    "from pytket.extensions.qiskit import tk_to_qiskit\n",
    "\n",
    "compiler_settings = CompilerSettings(tket=TKETSettings(placement=\"lineplacement\"))\n",
    "qc_mapped_level = get_benchmark(\n",
    "    benchmark_name=\"dj\",\n",
    "    level=\"mapped\",\n",
    "    circuit_size=5,\n",
    "    compiler=\"tket\",\n",
    "    compiler_settings=compiler_settings,\n",
    "    device_name=\"ionq_harmony\",\n",
    ")\n",
    "tk_to_qiskit(qc_mapped_level).draw(output=\"mpl\")"
   ]
  }
 ],
 "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"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
