{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "b5e62be9-cada-42d2-a2bb-7f3ee38aec51",
   "metadata": {},
   "source": [
    "# Playground"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "df1eaaad-6ad2-4601-8d12-3b02d9254bfa",
   "metadata": {},
   "outputs": [],
   "source": [
    "from galois import GF\n",
    "\n",
    "from circuit_compiler.compiler.boolean.bool_and import And\n",
    "from circuit_compiler.compiler.circuit import Circuit\n",
    "from circuit_compiler.compiler.nodes.leafs import Input\n",
    "\n",
    "gf = GF(5)\n",
    "\n",
    "xs = [Input(f\"x{i}\", gf) for i in range(11)]\n",
    "\n",
    "output = And(set(xs), gf)\n",
    "\n",
    "circuit = Circuit(outputs=[output], gf=gf)\n",
    "circuit.display_graph()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ce27d985-b20c-4f7e-a303-929598c61c17",
   "metadata": {},
   "outputs": [],
   "source": [
    "naive_arithmetic_circuit = circuit.arithmetize(\"naive\")\n",
    "naive_arithmetic_circuit.display_graph()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d5c0531f-f50b-4852-b81c-833a813eb235",
   "metadata": {},
   "outputs": [],
   "source": [
    "circuit._clear_cache()\n",
    "better_arithmetic_circuit = circuit.arithmetize(\"best-effort\")\n",
    "better_arithmetic_circuit.display_graph()"
   ]
  }
 ],
 "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",
   "version": "3.9.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
