{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "112037d9",
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "import re\n",
    "import tqdm\n",
    "from collections import defaultdict, Counter\n",
    "import pickle\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "import plotly.graph_objects as go\n",
    "from ipywidgets import Output, VBox\n",
    "import webbrowser\n",
    "from IPython.display import display, HTML, Javascript"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "68853da2",
   "metadata": {},
   "source": [
    "### get institutions from all fulltext papers"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "1ee84b07",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "10it [00:24,  2.76s/it]"
     ]
    }
   ],
   "source": [
    "fulltext_dir = \"/mnt/data-ssd-2/data/arxiv/fulltext/arxiv/\"  # 178 folders  \n",
    "        \n",
    "known_orgs = [\"facebook\", \"baidu\", \"microsoft\", \"google\", \"ibm\", \"nvidia\", \"amazon\"]\n",
    "\n",
    "paper_institutions = defaultdict(list)\n",
    "for root, subdirs, files in tqdm.tqdm(os.walk(fulltext_dir)):\n",
    "    for filename in files:\n",
    "        file_path = os.path.join(root, filename)\n",
    "        arxiv_id = re.search(r\"\\/([^\\/]+)\\.txt\", file_path)\n",
    "        if not arxiv_id:\n",
    "            continue\n",
    "        arxiv_id = arxiv_id.group(1)\n",
    "        if not re.match(r\"[0-9]+\\.[0-9]+\", arxiv_id):\n",
    "            continue\n",
    "        with open(file_path) as f:\n",
    "            # take first n characters or until 'abstract'\n",
    "            text = f.read()\n",
    "        emails = re.findall(r\"\\@([a-z0-9\\.\\-]+\\.[a-z]{2,4})\\b\", text, flags=re.IGNORECASE)\n",
    "        institutions = [re.sub(r\"\\.com$|\\.org$|\\.edu$\", \"\", s).capitalize() for s in emails]\n",
    "        institutions = [s for s in institutions if s not in (\"Gmail\", \"Hotmail\")]\n",
    "        if len(institutions) == 0:\n",
    "            # try looking for org strings\n",
    "            # be flexible with whitespace because headers are somethimes \"A BSTRACT\"\n",
    "            m_list = list(re.finditer(r\"[\\s\\n]{}[\\s\\n]\".format(r\"\\s*\".join(list(\"abstract\"))), text, flags=re.IGNORECASE))\n",
    "            if len(m_list) > 0:\n",
    "                text = text[:m_list[0].start()]\n",
    "            # be conservative \n",
    "            text = text[:1000]\n",
    "            orgs_found = re.findall(r\"|\".join([r\"(?<=[\\s\\n]){}(?=[\\,\\s\\n])\".format(s) for s in known_orgs]), text, flags=re.IGNORECASE)\n",
    "            if len(set(orgs_found)) == 1:\n",
    "                institutions.append(orgs_found[0].lower().capitalize())\n",
    "        paper_institutions[arxiv_id] = institutions"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e800c7ca",
   "metadata": {},
   "outputs": [],
   "source": [
    "# with open(\"/mnt/data-ssd-2/tmp/paper_institutions.pkl\", \"wb\") as f:\n",
    "#     pickle.dump(paper_institutions, f)\n",
    "# with open(\"/mnt/data-ssd-2/tmp/paper_institutions.pkl\", \"rb\") as f:\n",
    "#     paper_institutions = pickle.load(f)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "8f08c2dc",
   "metadata": {},
   "outputs": [],
   "source": [
    "# print(paper_institutions[\"2005.08100\"])\n",
    "# print(paper_institutions[\"2005.04290\"])\n",
    "# print(paper_institutions[\"2104.02014\"])"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4aa9be15",
   "metadata": {},
   "source": [
    "### get number of citations for papers"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "143843e7",
   "metadata": {},
   "outputs": [],
   "source": [
    "# fulltext_dir = \"/mnt/data-ssd-2/data/arxiv/fulltext/arxiv/\"  # 166 folders\n",
    "\n",
    "# citations = {}\n",
    "# for root, subdirs, files in tqdm.tqdm(os.walk(fulltext_dir)):\n",
    "#     for filename in files:\n",
    "#         file_path = os.path.join(root, filename)\n",
    "#         arxiv_id = re.search(r\"\\/([^\\/]+)\\.txt\", file_path)\n",
    "#         if not arxiv_id:\n",
    "#             continue\n",
    "#         arxiv_id = arxiv_id.group(1)\n",
    "#         if not re.match(r\"[0-9]+\\.[0-9]+\", arxiv_id):\n",
    "#             continue\n",
    "#         with open(file_path) as f:\n",
    "#             text = f.read()\n",
    "#         papers = list(set(re.findall(\"arXiv\\:\\s?([0-9]+\\.[0-9]+)\", text)) - set([arxiv_id]))\n",
    "#         citations[arxiv_id] = papers\n",
    "        \n",
    "# citation_count = Counter()\n",
    "# for _, v in citations.items():\n",
    "#     for arxiv_id in v:\n",
    "#         citation_count[arxiv_id] += 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 181,
   "id": "e12e4f0f",
   "metadata": {},
   "outputs": [],
   "source": [
    "# # with open(\"/mnt/data-ssd-2/tmp/citation_count.pkl\", \"wb\") as f:\n",
    "# #     pickle.dump(citation_count, f)\n",
    "# with open(\"/mnt/data-ssd-2/tmp/citation_count.pkl\", \"rb\") as f:\n",
    "#     citation_count = pickle.load(f)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "c8517e57",
   "metadata": {},
   "outputs": [],
   "source": [
    "# print(citation_count[\"2005.08100\"])\n",
    "# print(citation_count[\"2005.04290\"])\n",
    "# print(citation_count[\"2104.02014\"])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "9557c118",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c23a5189",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "86608d14",
   "metadata": {},
   "source": [
    "## Add to Metadata"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "9c6b1e37",
   "metadata": {},
   "outputs": [],
   "source": [
    "# meta_df = pd.read_json(\n",
    "#     \"/mnt/data-ssd-2/data/arxiv/metadata-oai-snapshot-01-01-2022_reduced.json\", \n",
    "#     dtype={\"id\": str},\n",
    "#     lines=True,\n",
    "# )\n",
    "# meta_df['submit_date'] = pd.to_datetime(meta_df['submit_date'], unit='ms')\n",
    "# # meta_df['date_helper'] = meta_df['submit_date'].dt.strftime('%Y%m')\n",
    "# # add citations\n",
    "# meta_df['n_citation'] = meta_df['id'].map(citation_count)\n",
    "# # add orgs\n",
    "# meta_df['orgs'] = meta_df['id'].map(paper_institutions)\n",
    "# rename_map = {\"Fb\": \"Facebook\"}\n",
    "# meta_df['orgs'] = [list(set([rename_map.get(s, s) for s in l]) - set([\"Gmail\"])) for l in meta_df['orgs'].values]\n",
    "# meta_df['orgs'] = meta_df['orgs'].apply(lambda x: \" & \".join(x))\n",
    "# # format title and abstract\n",
    "# # meta_df['title_html'] = meta_df['title'].str.strip().str.replace(r\"\\s*\\n\\s*\", \"<br>\", regex=True)\n",
    "# # meta_df['abstract_html'] = meta_df['abstract'].str.strip().str.replace(r\"\\s*\\n\\s*\", \"<br>\", regex=True)\n",
    "# meta_df['title'] = meta_df['title'].str.strip().str.replace(r\"\\s+\", \" \", regex=True)\n",
    "# meta_df['abstract'] = meta_df['abstract'].str.strip().str.replace(r\"\\s+\", \" \", regex=True)\n",
    "# # restrict output\n",
    "# meta_df = meta_df[[\n",
    "#     'id', \n",
    "#     \"title\", \"abstract\",\n",
    "# #     \"title_html\", \"abstract_html\",\n",
    "#     \"submit_date\",\n",
    "#     \"n_citation\", \n",
    "#     \"orgs\",\n",
    "# ]]\n",
    "# meta_df = meta_df.sort_values(\"submit_date\", ascending=True).reset_index(drop=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "7fc3a4c6",
   "metadata": {},
   "outputs": [],
   "source": [
    "# meta_df[meta_df[\"id\"] == \"2005.08100\"].iloc[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "082e5ea3",
   "metadata": {},
   "outputs": [],
   "source": [
    "# meta_df.to_json(\"/mnt/data-ssd-2/data/arxiv/arxiv_ml_meta.json\", lines=True, orient=\"records\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b8dd3998",
   "metadata": {},
   "outputs": [],
   "source": [
    "\"Done\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "11c2312f",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d5aac561",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "79040534",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "deb20c81",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "63787235",
   "metadata": {},
   "source": [
    "## Load Combined graph"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 185,
   "id": "8723ebbc",
   "metadata": {},
   "outputs": [],
   "source": [
    "new_meta_df = pd.read_json(\n",
    "    \"/mnt/data-ssd-2/data/arxiv/arxiv_ml_meta.json\", \n",
    "    dtype={\"id\": str},\n",
    "    lines=True,\n",
    ")\n",
    "new_meta_df['submit_date'] = pd.to_datetime(new_meta_df['submit_date'], unit='ms')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "08afc6f0",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "8bdc49ff",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "14778590",
   "metadata": {},
   "outputs": [],
   "source": [
    "# TODO: rank companies for multi-match\n",
    "# TODO: restrict extracted emails to first N characters to avoid references?\n",
    "# TODO: expand emails with companies for 1512.02595, 1910.10261, 1904.05862, 1703.02136, 2006.13979\n",
    "# TODO: additional metric for papers from last month?\n",
    "# TODO: normalize citations by age?\n",
    "# TODO: synonyms for filtering\n",
    "# TODO: filtering using fulltext?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "6b8f15be",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d69cb6a3",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "9e96f760",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "db5015f3",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "df5598b0",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "98e93504",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c091c29e",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "id": "0dd25a0f",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "485253c7",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "26d86971",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "342fa075",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "8f58411e",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "eafa9125",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "330a5c9e",
   "metadata": {},
   "source": [
    "## Playground"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 172,
   "id": "9c2dcb9a",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "4it [00:10,  2.51s/it]\n"
     ]
    }
   ],
   "source": [
    "fulltext_dir = \"/mnt/data-ssd-2/data/arxiv/fulltext/arxiv/\"  # 178 folders\n",
    "\n",
    "known_orgs = [\"facebook\", \"baidu\", \"microsoft\", \"google\", \"ibm\", \"nvidia\", \"amazon\"]\n",
    "\n",
    "n = 0\n",
    "\n",
    "\n",
    "paper_institutions = defaultdict(list)\n",
    "for root, subdirs, files in tqdm.tqdm(os.walk(fulltext_dir)):\n",
    "    for filename in files:\n",
    "        file_path = os.path.join(root, filename)\n",
    "        arxiv_id = re.search(r\"\\/([^\\/]+)\\.txt\", file_path)\n",
    "        if not arxiv_id:\n",
    "            continue\n",
    "        arxiv_id = arxiv_id.group(1)\n",
    "        if not re.match(r\"[0-9]+\\.[0-9]+\", arxiv_id):\n",
    "            continue\n",
    "        with open(file_path) as f:\n",
    "            # take first n characters or until 'abstract'\n",
    "            text = f.read()\n",
    "        emails = re.findall(r\"\\@([a-z0-9\\.\\-]+\\.[a-z]{2,4})\\b\", text, flags=re.IGNORECASE)\n",
    "        institutions = [re.sub(r\"\\.com$|\\.org$|\\.edu$\", \"\", s).capitalize() for s in emails]\n",
    "        institutions = [s for s in institutions if s not in (\"Gmail\", \"Hotmail\")]\n",
    "        if len(institutions) == 0:\n",
    "            # try looking for org strings\n",
    "            # be flexible with whitespace because headers are somethimes \"A BSTRACT\"\n",
    "            m_list = list(re.finditer(r\"[\\s\\n]{}[\\s\\n]\".format(r\"\\s*\".join(list(\"abstract\"))), text, flags=re.IGNORECASE))\n",
    "            if len(m_list) > 0:\n",
    "                text = text[:m_list[0].start()]\n",
    "            # be conservative \n",
    "            text = text[:1000]\n",
    "            orgs_found = re.findall(r\"|\".join([r\"[\\s\\n]{}[\\,\\s\\n]\".format(s) for s in known_orgs]), text, flags=re.IGNORECASE)\n",
    "            if len(set(orgs_found)) == 1:\n",
    "                institutions.append(orgs_found[0].lower().capitalize())\n",
    "        paper_institutions[arxiv_id] = institutions\n",
    "        \n",
    "        \n",
    "        \n",
    "    n += 1\n",
    "    if n == 5:\n",
    "        break"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "id": "e36ce6ff",
   "metadata": {},
   "outputs": [],
   "source": [
    "with open(\"/mnt/data-ssd-2/tmp/paper_institutions.pkl\", \"rb\") as f:\n",
    "    old_paper_institutions = pickle.load(f)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 177,
   "id": "0efa4936",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1908.07047\n",
      "['Google']\n",
      "['Gmail', 'Google', 'Gmail', 'Gmail', 'Gmail']\n"
     ]
    }
   ],
   "source": [
    "n_sample = 4\n",
    "\n",
    "n = 0\n",
    "for k, v in paper_institutions.items():\n",
    "    if len(v) != len(old_paper_institutions[k]) and any([\"Google\" in s for s in v]):\n",
    "        n += 1\n",
    "        if n == n_sample + 1:\n",
    "            print(k)\n",
    "            break\n",
    "\n",
    "print(paper_institutions[k])\n",
    "print(old_paper_institutions[k])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "79175361",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "bdf5f91e",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 186,
   "id": "ff4ecb11",
   "metadata": {},
   "outputs": [],
   "source": [
    "arxiv_id = \"2101.09624\"\n",
    "file_path = fulltext_dir + arxiv_id.split(\".\")[0] + \"/\" + arxiv_id + \".txt\"\n",
    "with open(file_path) as f:\n",
    "    # take first n characters or until 'abstract'\n",
    "    text = f.read()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 187,
   "id": "78cb5137",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "branch\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "[' microsoft,']"
      ]
     },
     "execution_count": 187,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "emails = re.findall(r\"\\@([a-z0-9\\.\\-]+\\.[a-z]{2,4})\\b\", text, flags=re.IGNORECASE)\n",
    "institutions = [re.sub(r\"\\.com$|\\.org$|\\.edu$\", \"\", s).capitalize() for s in emails]\n",
    "institutions = [s for s in institutions if s != \"Gmail\"]\n",
    "if len(institutions) == 0:\n",
    "    print('branch')\n",
    "    # try looking for org strings\n",
    "    # be flexible with whitespace because headers are somethimes \"A BSTRACT\"\n",
    "    m_list = list(re.finditer(r\"[\\s\\n]{}[\\s\\n]\".format(r\"\\s*\".join(list(\"abstract\"))), text, flags=re.IGNORECASE))\n",
    "    if len(m_list) > 0:\n",
    "        text = text[:m_list[0].start()]\n",
    "    # be conservative \n",
    "    text = text[:1000]\n",
    "    orgs_found = re.findall(r\"|\".join([r\"(?<=[\\s\\n]){}(?=[\\,\\s\\n])\".format(s) for s in known_orgs]), text, flags=re.IGNORECASE)\n",
    "    if len(set(orgs_found)) == 1:\n",
    "        institutions.append(orgs_found[0].lower().capitalize())\n",
    "institutions"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 197,
   "id": "798007fe",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['google', 'microsoft']"
      ]
     },
     "execution_count": 197,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "re.findall(r\"(?<=[\\s\\n])google(?=[\\,\\s\\n])|(?<=[\\s\\n])microsoft(?=[\\,\\s\\n])\", \"blabla google, microsoft \")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 171,
   "id": "922b547f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "\"DEFORMATIONS OF CALABI–YAU THREEFOLDS AND THEIR\\nMODULI OF VECTOR BUNDLES\\n\\narXiv:1612.09519v1 [math.AG] 30 Dec 2016\\n\\nE. GASPARIM, T. KÖPPE, F. RUBILAR, AND B. SUZUKI\\nA BSTRACT. We describe deformations of the noncompact Calabi–Yau\\nthreefolds Wk = Tot(OP1 (−k) ⊕ OP1 (k − 2)) for k = 1, 2, 3, as well as their\\nmoduli of holomorphic vector bundles of rank 2. Deformations are\\ncomputed concretely by calculations of H 1 (Wk , T Wk ). Information\\nabout the moduli of vector bundles is obtained by analysing bundles\\nthat are extensions of line bundles. We show that for each k = 1, 2, 3 the\\nassociated structures are qualitatively different, and we also comment\\non their difference from the analogous structures for the simpler noncompact twofolds Tot(OP1 (−k)) which had been studied previously by\\nthe authors.\\n\\nC ONTENTS\\n1. Motivation\\n2. Statements of results\\n3. Comparison with the deformation theory of surfaces\\n4. Some results about surfaces\\n4.1. A holomorphic bundle on Z(−1) that is not algebraic\\n4.2. Deformations of Zk\\n5. The threefolds Wk and their moduli of vector bundles\\n6. Rigidity of W1\\n7. Deformations of W2\\n7.1. A non-affine deformation\\n8. Deformations of W3\\nAcknowledgements\\nReferences\\n\\n1\\n2\\n3\\n4\\n4\\n6\\n7\\n8\\n8\\n10\\n11\\n13\\n13\\n\\n1. M OTIVATION\\nOur motivation to study deformations of Calabi–Yau threefolds comes\\nfrom mathematical physics. In fact, deformations of complex structures\\nof Calabi–Yau threefolds enter as terms of the integrals defining the action of the theories of Kodaira–Spencer gravity [B]. As we shall see, in general our threefolds will have infinite-dimensional deformation spaces,\\nthus allowing for rich applications. Here we describe their deformation\\ntheory and features of their moduli spaces of holomorphic vector bundles.\\n1\\n\\n\\x0c2\\n\\nE. GASPARIM, T. KÖPPE, F. RUBILAR, AND B. SUZUKI\\n\\nWe consider smooth Calabi–Yau threefolds Wk containing a line l ∼\\n= P1 .\\nFor the applications we have in mind for future work it will be useful to\\nobserve the effect of contracting the line to a singularity. The existence of\\na contraction of l imposes heavy restrictions on the normal bundle [Jim],\\nnamely Nl/W must be isomorphic to one of\\n(a) O P1 (−1)⊕O P1 (−1) , (b) O P1 (−2)⊕O P1 (0) , or (c) O P1 (−3)⊕O P1 (+1) .\\nConversely, Jiménez states that if P1 ∼\\n= l ⊂ W is any subspace of a smooth\\nthreefold W such that Nl/W is isomorphic to one of the above, then:\\n• in (a) l always contracts,\\n• in (b) either l contracts or it moves, and\\n• in case (c) there exists an example in which l does not contract\\nnor does any multiple of l (i.e. any scheme supported on l) move.\\nW1 is the space appearing in the basic flop. Let X be the cone over the\\nordinary double point defined by the equation x y − zw = 0 on C4 . The\\nbasic flop is described by the diagram:\\nW\\n6 ❆❆❆ p 2\\n66\\n❆❆\\n6\\n~66\\nW1− ❴ ❴ ❴ ❴/ W1+\\n❆❆\\n6\\n❆❆\\n66\\nπ1 ❆❆ \\x0f ~66 π2\\np1\\n\\n(1.1)\\n\\nX\\n\\nHere W := Wx,y,z,w is the blow-up of X at the vertex x = y = z = w = 0,\\nW1− := Z x,z is the small blow-up of X along x = z = 0 and W1+ := Z y,w is\\nthe small blow-up of X along y = w = 0. The basic flop is the rational map\\nfrom W − to W + . It is famous in algebraic geometry for being the first case\\nof a rational map that is not a blow-up.\\nThus, we will focus on the Calabi–Yau cases\\n¢\\n¡\\nWk := Tot O P1 (−k) ⊕ O P1 (k − 2) for k = 1, 2, 3.\\n\\nWe observe that from the point of view of moduli of vector bundles the\\ncases k ≥ 4 behave quite similarly to the case k = 3. We will also consider\\nsurfaces of the form\\n¡\\n¢\\nZk := Tot O P1 (−k)\\nfor comparison in Sections 3 and 4.\\n\\n2. S TATEMENTS OF RESULTS\\nWe describe deformations and moduli of vector bundles for complex surfaces and threefolds which are the total spaces of (sums of) line bundles\\non the complex projective line P1 .\\nRegarding surfaces, in contrast to what happens in the case of Zk with\\nk > 0, where all holomorphic vector bundles are algebraic [G1, Lem. 3.1,\\nThm. 3.2], we present in Prop. 4.2 a holomorphic vector bundle on Z(−1)\\nthat is not algebraic. Moreover, we prove that the deformations of the\\n\\n\\x0cDEFORMATIONS OF CALABI–YAU THREEFOLDS AND THEIR MODULI\\n\\n3\\n\\nsurfaces Zk , described in [BG], can be obtained from the deformations of\\nthe Hirzebruch surfaces Fk , Lem. 4.4.\\nFor the case of the Calabi–Yau threefolds Wk , Thm. 5.3 shows that the\\ngeneric part of the moduli of algebraic bundles of splitting type ( j , − j )\\n(see Def. 5.2) on Wk is smooth and of dimension 4 j − 5. Thm. 5.4 shows\\nthat all holomorphic bundles on W1 are algebraic; a detailed treatment\\nappears in [K]. In contrast, we present a holomorphic bundle on W3 that\\nis not algebraic, Cor. 4.3. For W1 the moduli of holomorphic bundles\\nis finite-dimensional, Cor. 5.5. For W2 , however, the moduli spaces are\\ninfinite-dimensional, Thm. 5.6, with greater detail appearing in [R].\\nOur results on deformations of the threefolds Wk are as follows. We\\nshow that W1 has no deformations, Thm. 6.1, whereas W2 has an infinitedimensional deformation space, Thm. 7.1. Furthermore, we exhibit a deformation W2 of W2 which turns out to be a non-affine manifold, a very\\ndifferent case from that of surfaces Zk , k > 0, where all the deformations\\nare affine varieties. Finally, we give an infinite-dimensional family of deformations of W3 which is not universal, but is semiuniversal, Cor. 8.4.\\nThe case W3 is quite different from W1 , W2 , or the surfaces. The tools\\nused so far to describe deformation spaces and moduli have not been sufficient for W3 , therefore must we look for more effective techniques. We\\nknow from Cor. 4.3 that W3 contains properly holomorphic bundles, and\\nthat we will have infinite-dimensional moduli spaces. The cases k ≥ 3\\npresent similar features; we will continue their study in future work.\\n\\n3. C OMPARISON WITH THE DEFORMATION THEORY OF SURFACES\\nSeveral results are known for the case of deformations of the surfaces Zk .\\nIt turned out rather interestingly that the results we obtained for threefolds are not at all analogous to the ones for surfaces.\\n[BGK2, Thm. 4.11] showed that the holomorphic vector bundles on Zk\\nwith splitting type (− j , j ) (see Def. 5.2) are quasiprojective varieties of dimension 2 j − k − 2. In contrast, we will see that moduli spaces of holomorphic bundles on the threefolds W2 and W3 are infinite-dimensional.\\n[BG, Thm. 6.11] showed that the moduli spaces of vector bundles on a\\nnontrivial deformation of Zk are zero-dimensional. Thus classical deformations of Zk do not give rise to deformations of their moduli of vector\\nbundles. This will not be the case for Wk .\\nRegarding applications to mathematical physics, the deformations of\\nsurfaces turned out rather disappointing, because instantons on Zk disappear under a small deformation of the base [BG, Thm. 7.3]. This resulted from the fact that deformations of Zk are affine varieties. The case\\nof threefolds is a lot more promising, since for k > 1, Wk has deformations\\nwhich are not affine.\\n\\n\\x0c4\\n\\nE. GASPARIM, T. KÖPPE, F. RUBILAR, AND B. SUZUKI\\n\\nNevertheless, deformations of the surfaces Zk turned out to have an\\ninteresting application to a question motivated by the Homological Mirror Symmetry conjecture. [BBGGS, Sec. 2] showed that the adjoint orbit of sl(2, C) has the complex structure of the nontrivial deformation of\\nZ2 , and it used this structure to construct a Landau–Ginzburg model that\\ndoes not have projective mirrors. Further applications to mirror symmetry give us another motivation to study deformation theory for Calabi–\\nYau threefolds.\\n4. S OME RESULTS ABOUT SURFACES\\nIn this section we prove some results about the surfaces Zk that will be\\nused in the development of the theory for threefolds.\\n4.1. A holomorphic bundle on Z(−1) that is not algebraic. By definition\\nZ(−1) = Tot(O P1 (+1)), and in canonical coordinates Z(−1) = U ∪ V , where\\nU = {(z, u)} and V = {(ξ, v )}, U ∩ V ∼\\n= C∗ × C, with change of coordinates\\ngiven by:\\n(ξ, v ) 7→ (z −1 , z −1 u)\\nLemma 4.1. H 1 (Z(−1) , O (−2)) is infinite-dimensional, generated as a vector space over C by the monomials z l u i with l = −2, −1 and i = 1, 2, . . . .\\nProof. A 1-cocycle σ can be written in the form\\n+∞\\nX +∞\\nX\\nσ=\\nσi ,l z l u i .\\ni =0 l =−∞\\n\\nSince monomials containing nonnegative powers of z are holomorphic\\nin U , these are coboundaries, thus\\n−1\\n+∞\\nX X\\nσ∼\\nσi ,l z l u i ,\\ni =0 l =−∞\\n\\nwhere ∼ denotes cohomological equivalence. Changing coordinates, we\\nobtain\\n+∞\\n+∞\\n−1\\n−1\\nX X\\nX X\\nT σ = z2\\nσi ,l z l u i =\\nσi ,l z l +2 u i ,\\ni =0 l =−∞\\n\\ni =0 l =−∞\\n\\nwhere terms satisfying l + 2 ≤ −1 are holomorphic on V . Thus, the nontrivial terms on H 1 (Z(−1) , O (−2)) are all those that have either l = −2 or\\nl = −1. Hence\\nH 1 (Z(−1) , O (−2)) = 〈z l u i : l = −2, −1 , i ≥ 1〉 .\\n\\n\\x03\\nProposition 4.2. The bundle E over Z(−1) defined in canonical coordinates\\nby the matrix\\n* 1\\n ̧\\nz z −1 e u\\n(4.1)\\n0\\nz −1\\nis holomorphic but not algebraic.\\n\\n\\x0cDEFORMATIONS OF CALABI–YAU THREEFOLDS AND THEIR MODULI\\n\\n5\\n\\nProof. This bundle E can be represented by the element\\nz −1 e u ∈ Ext1 (O (1), O (−1)) ≃ H 1 (Z(−1) , O (−2)).\\nWe have\\n(4.2)\\n\\n*\\n\\nz 1 z −1 e u\\n0\\nz −1\\n\\n ̧\\n\\n=\\n\\n*\\n\\nz 1 zσ\\n0 z −1\\n\\n ̧\\n\\nwith z −2 e u = σ ∈ H 1 (Z(−1) , O (−2)), see [Har, p. 234]. Observe that\\nμ\\n¶\\nu2\\nun\\n−2 u\\n−2\\n1+u +\\nz e\\n= z\\n+*** +\\n+***\\n2\\nn!\\n¶\\nμ\\nun\\nu2 u3\\n−2\\n−2\\n+\\n+*** +\\n+*** ,\\nu+\\n= z +z\\n2\\n6\\nn!\\n|\\n{z\\n}\\n(γ)\\n\\nwhere the monomials in γ ∈ 〈z l u i : l = −2, −1 , i ≥ 1〉 represent pairwise distinct nontrivial classes in H 1 (Z(−1) , O (−2)) as shown in Lemma\\n4.1. Consequently, the class zσ ∈ Ext1 (O (1), O (−1)) corresponding to the\\nbundle E cannot be represented by a polynomial, hence E is holomorphic but not algebraic.\\n\\x03\\nCorollary 4.3. The threefold W3 has holomorphic bundles that are not algebraic.\\nProof. Consider the map p : W3 → Z(−1) given by projection on the first\\nand third coordinates, that is, in canonical coordinates as in (8.1) we see\\nZ(−1) as cut out inside W3 by the equation u 1 = 0. Then the pullback bundle p ∗ E is holomorphic but not algebraic on W3 .\\n\\x03\\n4.1.1. A similar bundle on Z1 . It is instructive to verify the result of defining a bundle by the same matrix, but over the surface Z1 instead. Recall\\nthat Z1 = U ∪ V , with change of coordinates given by:\\n(ξ, v ) 7→ (z −1 , zu)\\n\\nConsider the bundle E on Z1 , given by transition matrix\\n* 1\\n ̧\\nz z −1 e u\\n(4.3)\\n.\\n0\\nz −1\\nNote that this is the same matrix used in (4.1). Thus E corresponds to\\nthe element z −1 e u ∈ Ext1 (O (1), O (−1)) ≃ H 1 (Z1 , O (−2)). Consequently, we\\nmay rewrite the transition function\\n* 1\\n ̧\\n ̧ * 1\\nz z −1 e u\\nz\\nzσ\\n(4.4)\\n=\\n0 z −1\\n0\\nz −1\\nwhere z −2 u = σ ∈ H 1 (Z1 , O (−2)). But σ = ξ3 v is holomorphic on the V\\nchart, and hence a coboundary. Thus σ = 0 ∈ H 1 (Z1 , O (−2)), and accordingly z −1 e u = 0 ∈ Ext1 (O (1), O (−1)). Therefore the extension splits and\\nE = O (−1) ⊕ O (1) .\\n\\n\\x0c6\\n\\nE. GASPARIM, T. KÖPPE, F. RUBILAR, AND B. SUZUKI\\n\\n4.2. Deformations of Zk . [BG, Thm. 5.3] construct a (k − 1)-dimensional\\nsemiuniversal deformation space Z for Zk given by\\n(ξ, v, t1 , . . . , tk−1 ) = (z −1 , z k u + tk−1 z k−1 + * * * + t1 z, t1 , . . . , tk ) .\\n\\n(4.5)\\n\\nLemma 4.4. Deformations of Zk can be obtained from deformations of Fk .\\nThus, the family Z is is not universal.\\nProof. We compare deformations of the surfaces Zk with those of the\\nHirzebruch surfaces. Let us first rewrite them as homogeneous manifolds. The surface Zk = Tot(O P1 (−k)) can also be written as the quotient\\nZk =\\n\\n(C2 − {0}) × C\\n,\\nC − {0}\\n\\nwhere the action is given by\\n(l 0 , l 1 , t ) ∼ (λl 0 , λl 1 , λ−k t ) ,\\nwith λ ∈ C − {0}. For k ∈ Z+ , the Hirzebruch surface Fk can also be written\\nas the quotient\\n(C2 − {0}) × (C2 − {0})\\nFk =\\n,\\n(C − {0}) × (C − {0})\\nwhere the action is given by\\n(l 0 , l 1 , t0 , t1 ) ∼ (λl 0 , λl 1 , λk μt0 , μt1 ) ,\\nwith λ, μ ∈ C − {0}. Choose coordinates (t1 , . . . , tk−1 , [l 0 , l 1 ], [x0 , . . . , xk+1 ])\\nfor the product Ck−1\\n× P1l × Pk+1\\nx . [M, Chap. II] shows that the Hirzebruch\\nt\\nsurface Fk has a (k − 1)-dimensional semiuniversal deformation space\\ngiven by the smooth subvariety M ⊂ Ck−1\\n×P1l ×Pk+1\\ncut out by the equax\\nt\\ntions\\n(4.6)\\n\\nl 0 (x1 , x2 , . . . , xk ) = l 1 (x2 − t1 x0 , . . . , xk − tk−1 x0 , xk+1 ) .\\n\\nLet Z and M denote the deformations given by 4.5 and 4.6, respectively. Now consider the following map:\\nf:Z → M\\n(z, u, t1 , . . . , tk−1 ) 7→ (t1 , . . . , tk−1 , [1, z], [−1, z 1 , . . . , z k , u])\\n(ξ, v, t1 , . . . , tk−1 ) 7→ (t1 , . . . , tk−1 , [ξ, 1], [−1, v, ξ2 , . . . , ξk+1 ])\\nwhere we used the following notation:\\nz 1 = z k u + tk−1 z k−1 + * * * + t1 z\\n\\nξ2 = ξv − t1\\n\\nz 2 = z k−1 u + tk−1 z k−2 + * * * + t2 z\\n\\nξ3 = ξ2 v − t1 ξ − t2\\n\\n..\\n.\\nz k−1 = z 2 u + tk−1 z\\nz k = zu\\n\\n..\\n.\\nξk = ξk−1 v − t1 ξk−2 − * * * − tk−1\\nξk+1 = ξk v − t1 ξk−1 − * * * − tk−1 ξ\\n\\n\\x0cDEFORMATIONS OF CALABI–YAU THREEFOLDS AND THEIR MODULI\\n\\n7\\n\\nIt turns out that this map is injective and satisfies f (Z t ) ⊂ M t for all t ∈\\nCk−1 . Notice that, for each t ∈ Ck−1 , we can decompose M t as\\nMt = A t ∪ B t ,\\nwhere A t = {p ∈ M t , x0 = 0} and B t = {p ∈ M t , x0 6= 0}. It then follows that\\n• B t = f (Z t ), and\\n• A t is the boundary of B t ,\\nimplying as a corollary that: M t = M t ′ if and only if Z t = Z t ′ .\\nSo we conclude that each Zk has as many deformations as Fk , specifically, ⌊k/2⌋. In particular, the deformation family of Zk is not universal.\\n\\x03\\n5. T HE THREEFOLDS Wk AND THEIR MODULI OF VECTOR BUNDLES\\nThe threefolds Wk = Tot(O P1 (−k)) ⊕ O P1 (k − 2)) can be given canonical\\ncoordinate charts as follows.\\nNotation 5.1. We fix once and for all coordinate charts on Wk , to which\\nwe will refer as canonical coordinates,\\n©\\na\\n©\\na\\n(5.1)\\nU = C3 = (z, u 1 , u 2 )\\nand\\nV = C3 = (ξ, v 1 , v 2 ) ,\\n\\nsuch that on the intersection U ∩ V = C − {0} × C × C they satisfy\\n(5.2)\\n\\n(ξ, v 1 , v 2 ) = (z −1 , z k u 1 , z 2−k u 2 ) .\\n\\nDefinition 5.2. Let E be a holomorphic rank-r vector bundle on Wk (or\\nZk ), and consider the restriction of E to the distinguished line P1 ⊂ Wk\\n(or P1 ⊂ Zk ). By Grothendieck's splitting principle there are integers ai\\nsuch that E |P1 = O P1 (a1 ) ⊕ * * * ⊕ O P1 (ar ). We call (a1 , * * * , ar ) the splitting\\ntype of E .\\nKöppe studied moduli of algebraic rank-2 vector bundles on Wk for\\nk = 1, 2, 3. The variety formed by vector bundles whose extension class is\\nnontrivial on the first infinitesimal neighbourhood of the P1 forms what\\ncan be regarded as the generic part of the moduli space M j (Wk ) of bundles on Wk with splitting type (− j , j ).\\nTheorem 5.3. [K, Prop. 3.20] For k = 1, 2, 3, the generic part of the moduli\\nof algebraic bundles M j (Wk ) is smooth of dimension 4 j − 5.\\nWe observe that the cases of moduli of algebraic bundles on Wk for\\nk > 3 have not been described in the literature, but it seems most likely\\nthat they present a similar behaviour as the case k = 3 with the same dimension for the generic part of the moduli of rank-2 algebraic bundles.\\nThus, the generic part of these moduli of vector bundles does not provide\\nany tool for distinguishing these threefolds from one another. We will see\\nthat the situation is quite the opposite with respect to their deformation\\ntheory. The situation changes a bit when we consider holomorphic bundles. We have:\\n\\n\\x0c8\\n\\nE. GASPARIM, T. KÖPPE, F. RUBILAR, AND B. SUZUKI\\n\\nTheorem 5.4. [K, Thm. 3.10] Holomorphic bundles on W1 are filtrable and\\nalgebraic.\\nCorollary 5.5. Moduli spaces of holomorphic bundles on W1 are finitedimensional.\\nTheorem 5.6. W2 has infinite-dimensional moduli of holomorphic bundles.\\nProof. For brevity we give just an example. Consider the moduli space\\nthat contains the tangent bundle of W2 . The Zariski tangent space of\\nthis moduli space at T W2 is given by the cohomology H 1 (W2 , End(T W2 )),\\nwhich is infinite-dimensional. Indeed, Čech cohomology calculations\\nshow that H 1 (W2 , End(T W2 )) is generated as a C-vector space by the following cocycles:\\n(0, . . ., 0, z −1 u 1 u 2k , 0 . . . , 0), (0, . . . , 0, z −i u 2k , 0 . . ., 0) for i = 1, 2, 3, and\\n| {z }\\n| {z }\\n4\\n\\n4\\n\\n(0, . . . , 0, z −1 u 2k , 0 . . . , 0), (0, . . ., 0, z −1 u 2k , 0 . . . , 0)\\n| {z }\\n\\nfor k ≥ 0.\\n\\n| {z }\\n\\n6\\n\\n7\\n\\n\\x03\\n\\n6. R IGIDITY OF W1\\nTheorem 6.1. [R] W1 is rigid, that is, its complex structure has no deformations.\\nProof. Deformations of complex structures are parametrised by first cohomology with coefficients in the tangent bundle. Direct calculation of\\nČech cohomology shows that H 1 (W1 , T W1 ) = 0.\\n\\x03\\n7. D EFORMATIONS OF W2\\nTheorem 7.1. [R] W2 has an infinite-dimensional family of deformations.\\nProof. The proof will follow from Lemmas 7.2 and 7.3 below. First we\\nshow that the first cohomology with tangent coefficients is infinite-dimensional. Then we show that its cocycles are integrable, and thus they\\nparametise deformations of W2 .\\n\\x03\\nLemma 7.2. H 1 (W2 , T W2 ) is generated as a vector space over C by cocycles\\nj\\nof the form (0, z −1 u 2 , 0), j ≥ 0 (written in canonical coordinates).\\nProof. Recall that W2 can be covered by\\nU = {(z, u 1 , u 2 )} and V = {(ξ, v 1 , v 2 )} ,\\nwith U ∩ V = C − {0} × C × C and transition function given by:\\n(ξ, v 1 , v 2 ) = (z −1 , z 2 u 1 , u 2 )\\n\\n\\x0cDEFORMATIONS OF CALABI–YAU THREEFOLDS AND THEIR MODULI\\n\\n9\\n\\nWe have then that the transition function for T W2 is\\n\\uf8ee\\n\\uf8f9\\n−z −2 0 0\\nA = \\uf8f0 2zu 1 z 2 0 \\uf8fb .\\n0\\n0 1\\nLet σ be a 1-cocycle, i.e. a holomorphic function on U ∩ V :\\n\\uf8ee\\n\\n\\uf8f9\\nal i j\\n\\uf8f0 bl i j \\uf8fb z l u i u j .\\nσ=\\n1 2\\nj =0 i =0 l =−∞\\ncl i j\\n∞\\n∞ X\\n∞ X\\nX\\n\\nBut\\n\\uf8ee\\n\\n\\uf8f9\\nal i j\\n\\uf8f0 bl i j \\uf8fb z l u i u j\\n1 2\\nj =0 i =0 l =0\\ncl i j\\n∞ X\\n∞ X\\n∞\\nX\\n\\nis a coboundary, so\\n\\uf8ee\\n\\n\\uf8f9\\nal i j\\n\\uf8f0 b l i j \\uf8fb z l u i u j = σ′ ,\\nσ∼\\n1 2\\nj =0 i =0 l =−∞\\ncl i j\\n∞ X\\n∞ X\\n−1\\nX\\n\\nwhere ∼ denotes cohomological equivalence. So\\n\\uf8ee\\n\\n\\uf8f9\\n−al i j z −2\\n\\uf8f0 2al i j zu 1 + b l i j z 2 \\uf8fb z l u i u j\\nAσ′ =\\n1 2\\nj =0 i =0 l =−∞\\ncl i j\\n\\uf8ee\\n\\uf8f9\\n−al i j z −4\\n∞ X\\n∞ X\\n−1\\nX\\n\\uf8f0 2al i j z −3 (z 2 u 1 ) + b l i j \\uf8fb z 2+l −2i (z 2 u 1 )i u j\\n=\\n2\\nj =0 i =0 l =−∞\\ncl i j z −2\\n\\uf8ee\\n\\uf8f9\\n−al i j ξ4\\n∞ X\\n∞ X\\n−1\\nX\\n\\uf8f0 2al i j ξ3 v 1 + b l i j \\uf8fb ξ2i −l −2 v i v j .\\n=\\n1 2\\nj =0 i =0 l =−∞\\ncl i j ξ2\\n∞ X\\n∞ X\\n−1\\nX\\n\\nExcept for the case where l = −1 and i = 0, we have that 2i − l − 2 ≥\\n0, thus the corresponding monomials are holomorphic in V and hence\\ncoboundaries. It follows that\\n\\uf8ee\\n\\uf8f9\\n−a j ξ4\\n∞\\nX\\n\\uf8f0 2a j ξ3 v 1 + b j \\uf8fb ξ−1 v j\\nAσ′ ∼\\n2\\nj =0\\nc j ξ2\\n\\uf8f9\\n\\uf8ee\\n0\\n∞\\nX\\n\\uf8f0 b j \\uf8fb ξ−1 v j ,\\n∼\\n2\\nj =0\\n0\\n\\n\\x0c10\\n\\nE. GASPARIM, T. KÖPPE, F. RUBILAR, AND B. SUZUKI\\n\\nwhere we omit the indices −1 for l and 0 for i for simplicity. We conclude\\nthen that H 1 (W2 , T W2 ) is infinite-dimensional, generated by the sections\\n\\uf8ee\\n\\uf8f9\\n0\\nσ j = \\uf8f0 z −1 u 2j \\uf8fb\\n0\\nfor j ≥ 0.\\n\\n\\x03\\n\\nLemma 7.3. All cocycles in H 1 (W2 , T W2 ) are integrable.\\nProof. We can write the transition of W2 as:\\n\\uf8ee\\n\\uf8f9 \\uf8ee −1 \\uf8f9 \\uf8ee −2\\n\\uf8f9\\uf8ee\\n\\uf8f9\\nz\\nξ\\nz\\n0 0\\nz\\n\\uf8f0 v 1 \\uf8fb = \\uf8f0 z 2 u1 \\uf8fb = \\uf8f0 0 z 2 0 \\uf8fb \\uf8f0 u1 \\uf8fb .\\nv2\\nu2\\n0\\n0 1\\nu2\\nAs we computed in Lemma 7.2, H 1 (W2 , T W2 ) is generated by the sections\\n\\uf8ee\\n\\uf8f9\\n0\\n\\uf8f0 z −1 u j \\uf8fb\\n0\\n\\n2\\n\\nfor j ≥ 0. Then we can express the deformation family for W2 as\\n\\uf8f9 \\uf8eb\\uf8ee\\n\\uf8f9\\n\\uf8ee\\n\\uf8ee\\n\\uf8f9 \\uf8ee −2\\n\\uf8f9\\uf8f6\\n0\\nz\\n0 0\\nz\\nξ\\nX\\n\\uf8f0 v 1 \\uf8fb = \\uf8f0 0 z 2 0 \\uf8fb \\uf8ed\\uf8f0 u 1 \\uf8fb +\\nt j \\uf8f0 z −1 u 2j \\uf8fb\\uf8f8\\nj ≥0\\nu2\\nv2\\n0\\n0 1\\n0\\n\\uf8ee\\n\\uf8f9\\nz −1\\nP\\n= \\uf8f0 z 2 u 1 + j ≥0 t j zu 2j \\uf8fb ,\\nu2\\ni.e. we have an infinite-dimensional deformation family given by\\nU = C3z,u1 ,u2 × C[t j ] and V = C3ξ,v 1 ,v 2 × C[t j ]\\nwith\\n(ξ, v 1 , v 2 , t0 , t1 , . . .) = (z −1 , z 2 u 1 +\\n\\nX\\n\\nj ≥0\\n\\nj\\n\\nt j zu 2 , u 2 , t0 , t1 , . . . )\\n\\n2\\n\\non the intersection U ∩ V = (C − {0}) × C × C[t j ].\\n\\n\\x03\\n\\n7.1. A non-affine deformation. The proof of 7.3 gives us that deformations of W2 are threefolds given by change of coordinates of the form\\nX\\nj\\n(ξ, v 1 , v 2 ) = (z −1 , z 2 u 1 +\\nt j zu 2 , u 2 ) .\\nj ≥0\\n\\nWe consider now the example W2 that occurs when t1 = 1 and all t j vanish\\nfor j 6= 1, that is, the one with change of coordinates\\n(ξ, v 1 , v 2 ) = (z −1 , z 2 u 1 + zu 2 , u 2 ).\\nLemma 7.4. H 1 (W2 , O (−4)) 6= 0.\\n\\n\\x0cDEFORMATIONS OF CALABI–YAU THREEFOLDS AND THEIR MODULI\\n\\n11\\n\\nProof. Consider the 1-cocycle σ written in the U coordinate chart as σ =\\nz −1 . Suppose σ is a coboundary, then we must have\\nσ = α + T −1 β\\nwhere α ∈ Γ(U ) and β = Γ(V ). Consequently\\nz −1 = α(z, u 1 , u 2 ) + z −4 β(z −1 , z 2 u 1 + zu 2 , u 2 ) .\\nBut α has only positive powers of z, and the highest power of z appearing\\non z −4 β is −4, hence the right-hand side has no terms in z −1 and the\\nequation is impossible, a contradiction.\\n\\x03\\nCorollary 7.5. W2 is not affine.\\nRemark 7.6. Note that this result contrasts with the situation for surfaces,\\nsince [BG, Thm. 6.15] prove that all nontrivial deformations of Zk are affine.\\n8. D EFORMATIONS OF W3\\nWe start by computing the group H 1 (W3 , T W3) which parametrises deformations of W3 . Recall that W3 can be covered by U = {(z, u 1 , u 2 )} and\\nV = {(ξ, v 1 , v 2 )}, with U ∩V = C−{0}×C2 and transition function given by:\\n(8.1)\\n\\n(ξ, v 1 , v 2 ) = (z −1 , z 3 u 1 , z −1 u 2 )\\n\\nTheorem 8.1. There is a versal deformation space W for W3 parametrised\\nby cocycles of the form\\n\\uf8ee\\n\\uf8f9\\nal i j\\n\\uf8f0 bl i j \\uf8fb z l u i u j\\n3i − 3 − l − j < 0.\\n1 2\\ncl i j\\nProof. In canonical coordinates, the transition matrix for the tangent bundle T W3 is given by\\n\\uf8f9 \\uf8ee −1\\n\\uf8ee\\n\\uf8f9\\n−z −2\\n0\\n0\\nz\\n0 −z −2 u 2\\n(8.2)\\nT = \\uf8f0 3z 2 u 1 z 3 0 \\uf8fb ≃ \\uf8f0 0 z 3 3z 2 u 1 \\uf8fb ,\\n−z −2 u 2 0 z −1\\n0\\n0\\n−z −2\\nwhere ≃ denotes isomorphism, and the latter expression is handier for\\ncalculations. A 1-cocycle can be expressed in U coordinates in the form\\n\\uf8ee\\n\\uf8f9\\nal i j\\n∞ X\\n∞ X\\n∞\\nX\\n\\uf8f0 bl i j \\uf8fb z l u i u j\\nσ=\\n1 2\\nj =0 i =0 l =−∞\\ncl i j\\n\\uf8ee\\n\\uf8f9\\nal i j\\n∞ X\\n∞ X\\n−1\\nX\\n\\uf8f0 bl i j \\uf8fb z l u i u j ,\\n∼\\n1 2\\nj =0 i =0 l =−∞\\ncl i j\\n\\n\\x0c12\\n\\nE. GASPARIM, T. KÖPPE, F. RUBILAR, AND B. SUZUKI\\n\\nwhere ∼ denotes cohomological equivalence. Changing coordinates we\\nobtain\\n\\uf8ee\\n\\uf8f9\\n−1\\n−2\\na\\nz\\n−\\nc\\nz\\nu\\n2\\nl\\ni\\nj\\nl\\ni\\nj\\n∞\\n∞\\n−1\\nXX X\\n\\uf8f0 3al i j z 2 u 1 + b l i j z 3 \\uf8fb z l u i u j\\nTσ=\\n1 2\\nj =0 i =0 l =−∞\\n−cl i j z −2\\nwhere all terms inside the matrix are holomorphic on V except for\\n\\uf8f9\\n\\uf8ee\\n0\\n\\uf8f0b l i j z 3 \\uf8fb .\\n0\\nThese impose the condition for a cocycle to be nontrivial. Since we have\\nj\\n\\nj\\n\\nz 3 z l u 1i u 2 = z l +3−3i +j (z 3 u 1 )i (z −1 u 2 ) j = ξ3i −3−l −j u 1i u 2 ,\\na nontrivial cocycle satisfies 3i − 3 − l − j < 0.\\n\\n\\x03\\n\\nWe now give a partial description of deformations of W3 .\\nLemma 8.2. The sections\\n\\uf8ee\\n\\n0\\n\\n\\uf8f9\\n\\n\\uf8ee\\n\\n0\\n\\n\\uf8f9\\n\\nσ1 = \\uf8f0 z −1 \\uf8fb and σ2 = \\uf8f0 z −2 \\uf8fb\\n0\\n0\\nare nonzero cocycles on H 1 (W3 , T W3 ).\\nProof. Let\\n\\uf8ee\\n\\n\\uf8f9\\no\\nσl = \\uf8f0 z −l \\uf8fb ,\\n0\\nfor l = 1, 2. Then σl is not a coboundary on the chart U . We change\\ncoordinates by multiplying by the transition T given in 8.2,\\n\\uf8f9 \\uf8ee\\n\\uf8f9\\n\\uf8ee\\n0\\n0\\nT σl = \\uf8f0 z l +3 \\uf8fb = \\uf8f0 ξ−l −3 \\uf8fb ,\\n0\\n0\\nwhich is not holomorphic on the chart V and therefore not a coboundary.\\n\\n\\x03\\nLemma 8.3. The following 2-parameter family of deformations of W3 is\\ncontained in W :\\n(ξ, v 1 , v 2 ) = (z −1 , z 3 u 1 + t2 z 2 + t1 z, z −1 u 2 )\\nProof. The transition for W3 is given by,\\n(ξ, v 1 , v 2 ) = (z −1 , z 3 u 1 , z −1 u 2 ).\\n\\n\\x0cDEFORMATIONS OF CALABI–YAU THREEFOLDS AND THEIR MODULI\\n\\n13\\n\\nIn matrix form:\\n\\uf8ee\\n\\n\\uf8f9 \\uf8ee −2\\n\\uf8f9\\uf8ee\\n\\uf8f9\\nξ\\nz\\nz\\n0\\n0\\n\\uf8f0 v 1 \\uf8fb = \\uf8f0 0 z 3 0 \\uf8fb \\uf8f0 u1 \\uf8fb\\nv2\\nu2\\n0\\n0 z −1\\nSo we can construct a deformation family for W3 using the cocycles from\\nLemma 8.2:\\n\\uf8ee\\n\\uf8f9 \\uf8ee −2\\n\\uf8f9 \\uf8eb\\uf8ee\\n\\uf8f9\\n\\uf8f9\\n\\uf8ee\\n\\uf8f9\\uf8f6\\n\\uf8ee\\nξ\\nz\\nz\\n0\\n0\\n0\\n0\\n\\uf8f0 v 1 \\uf8fb = \\uf8f0 0 z 3 0 \\uf8fb \\uf8ed\\uf8f0 u 1 \\uf8fb + t2 \\uf8f0 z −1 \\uf8fb + t1 \\uf8f0 z −2 \\uf8fb\\uf8f8\\nv2\\nu2\\n0\\n0\\n0\\n0 z −1\\n\\uf8ee\\n\\uf8f9\\nz −1\\n3\\n= \\uf8f0 z u1 + t2 z 2 + t1 z \\uf8fb\\nz −1 v 2\\nNow it suffices to observe that, by Lemma 8.2, σ1 and σ2 are nontrivial\\ndirections in W .\\n\\x03\\nCorollary 8.4. The family presented in Theorem 8.3 is semiuniversal but\\nnot universal.\\nProof. As a consequence of Lemma 8.3 and Corollary 4.4, we have that\\nthe deformations in the directions of the cocycles of Lemma 8.2 are isomorphic. Indeed, these deformations are induced by Z3 which, as F3 ,\\nonly has one nontrivial direction of deformation.\\n\\x03\\nACKNOWLEDGEMENTS\\nResults of this paper were presented by Gasparim and Suzuki in their talks\\nat the Geometry and Physics session of the V Congreso Latinoamericano\\nde Matemáticas. These authors thank UMALCA, Universidad del Norte\\nand the Colombian Mathematical Society for the financial support and\\nhospitality. Gasparim thanks also the Vice Rectoría de Investicagión y Desarrollo tecnológico at Universidad Católica del Norte (Chile). Suzuki acknowledges support from the Beca Doctorado Nacional – Folio 21160257.\\nThe authors thank Bernardo Uribe for the invitation to organise a session at the congress as well as for giving us the opportunity to submit our\\ncontribution to these proceedings.\\nR EFERENCES\\n[ABCG]\\n\\nAmilburu, C.C., Barmeier, S., Callander, B., Gasparim, E., Isomorphisms of\\nmoduli spaces, Matemática Contemporânea, 41: 1–16, 2012.\\n[BV]\\nBalaji, V., Vishwanath, P.A., On the deformations of certain moduli spaces of\\nvector bundles, American Journal of Mathematics, 115 (2): 279–303, 1993.\\n[B]\\nBershadsky, M. Kodaira–Spencer theory of gravity, Quantum Field Theory and\\nString Theory, NATO ASI Series 328: pp 23–38, 1995.\\n[BBGGS] Ballico, E., Barmeier, S., Gasparim, E., Grama, L., San Martin, L.A.B., A Lie theoretical construction of a Landau–Ginzburg model without projective mirrors,\\narXiv:1610.06965.\\n\\n\\x0c14\\n\\nE. GASPARIM, T. KÖPPE, F. RUBILAR, AND B. SUZUKI\\n\\n[BBG]\\n\\n[BG]\\n[BalG]\\n[BGK1]\\n[BGK2]\\n\\n[G1]\\n[G2]\\n[GGS]\\n[GKM]\\n\\n[Har]\\n[Jim]\\n[K]\\n[M]\\n[NR]\\n\\n[OSS]\\n[R]\\n[S]\\n\\nBen-Bassat, O., Gasparim, E., Moduli stacks of bundles on local surfaces, in\\nR. Castano-Bernard, F. Catanese, M. Kontsevich, T. Pantev, Y. Soibelman &\\nI. Zharkov (eds.) Homological Mirror Symmetry and Tropical Geometry, Lecture Notes of the Unione Matematica Italiana 15, 1–32, 2014.\\nBarmeier, S., Gasparim, E. Classical deformations of local surfaces and their\\nmoduli spaces of instantons, arXiv:1604.01133.\\nBallico, E., Gasparim, E., Numerical invariants for bundles on blow-ups, Proc.\\nAmer. Math. Soc. 130 no. 1, 23–32, 2002.\\nBallico, E., Gasparim, E., Köppe, T., Local moduli of holomorphic bundles,\\nJournal of Pure and Applied Algebra, 213 (4): 397–408, 2009.\\nBallico, E., Gasparim, E., Köppe, T., Vector bundles near negative curves: moduli and local Euler characteristic, Communications in Algebra, 37 (8): 2688–\\n2713, 2009.\\nGasparim, E., Holomorphic bundles on O(−k) are algebraic, Communications\\nin Algebra, 25 (9): 3001–3009, 1997.\\nGasparim, E., Rank two bundles on the blow-up of C2 , Journal of Algebra, 199:\\n581–590, 1998.\\nGasparim, E., Grama, L., San Martin, L. A. B., Symplectic Lefschetz fibrations\\non adjoint orbits, Forum Math. 28 n. 5, 967–980 (2016).\\nGasparim, E., Köppe, T., Majumdar, P., Local holomorphic Euler characteristic\\nand instanton decay, Pure Appl. Math. Q. 4, no. 2, Special Issue: In honor of\\nFedya Bogomolov, Part 1, 161–179, 2008.\\nR. Hartshorne, Algebraic Geometry, Springer-Verlag, New York, 1977, Graduate\\nTexts in Mathematics, No.52.\\nJ. Jiménez, Contraction of nonsingular curves, Duke Math. J. 65 (1992), no. 2,\\n313–332.\\nKöppe, T. Moduli of bundles on local surfaces and threefolds, Ph. D. Thesis, The\\nUniversity of Edinburgh, 2010.\\nManetti, M., Lectures on deformations of complex manifolds, Rendiconti di\\nMatematica, 24 (1): 1–183, 2004.\\nNarasimhan, M.S., Ramanan, S., Deformations of the moduli space of vector\\nbundles over an algebraic curve, Annals of Mathematics, 101 (3): 391–417,\\n1975.\\nOkonek, C., Schneider, M., Spindler, H., Vector bundles on complex projective\\nspaces, Progress in Mathematics 3, Boston: Birkhäuser, 1980.\\nRubilar, F. Deformaciones de estructuras complejas de 3-variedades Calabi–\\nYau, tesis de magister, Universidad Católica del Norte, Chile (2017).\\nSeshadri, C. S., Theory of Moduli, Proceedings of Symposia in Pure Mathematics, Vol. XXIX (Algebraic Geometry - Arcata 1974), pp. 263-304.\\n\\nE. Gasparim1, T. Köppe2, F. Rubilar3, B. Suzuki4\\nDepartamento de Matemáticas\\nUniversidad Católica del Norte\\nAv. Angamos 0600\\nAntofagasta\\nChile\\n1\\n\\netgasparim@gmail.com\\ntkoeppe@google.com\\n3\\nrubilar_n17@hotmail.com\\n4\\nobrunosuzuki@gmail.com\\n2\\n\\n\\x0c\""
      ]
     },
     "execution_count": 171,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "text"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3b488724",
   "metadata": {},
   "outputs": [],
   "source": [
    "\"ryo-mkm@math.kyoto-u.ac.jp\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 105,
   "id": "3d196762",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['math.kyoto-u.ac.jp']"
      ]
     },
     "execution_count": 105,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "re.findall(r\"\\@([a-z\\.\\-]+\\.[a-z]{2,4})\", \"ryo-mkm@math.kyoto-u.ac.jp\", flags=re.IGNORECASE)\n",
    "re.sub(r\"\\.com$|\\.org$\", \"\", 'math.kyoto-u.ac.jp')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 111,
   "id": "124f1816",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'math.kyoto-u.ac.jp'"
      ]
     },
     "execution_count": 111,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "re.sub(r\"\\.com$|\\.org$\", \"\", 'math.kyoto-u.ac.jp')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "332d8867",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "668899d6",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 98,
   "id": "03131f12",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1512.02595 ['Baidu']\n",
      "1910.10261 ['Nvidia']\n",
      "1904.05862 ['Facebook']\n",
      "1703.02136 ['Ibm']\n",
      "2006.13979 ['Facebook']\n"
     ]
    }
   ],
   "source": [
    "fulltext_dir = \"/mnt/data-ssd-2/data/arxiv/fulltext/arxiv/\"  # 178 folders\n",
    "\n",
    "known_orgs = [\"facebook\", \"baidu\", \"microsoft\", \"google\", \"ibm\", \"nvidia\", \"amazon\"]\n",
    "\n",
    "for arxiv_id in [\"1512.02595\", \"1910.10261\", \"1904.05862\", \"1703.02136\", \"2006.13979\"]:\n",
    "    file_path = fulltext_dir + arxiv_id.split(\".\")[0] + \"/\" + arxiv_id + \".txt\"\n",
    "    with open(file_path) as f:\n",
    "        # take first n characters or until 'abstract'\n",
    "        text = f.read()\n",
    "        # be flexible with whitespace because headers are somethimes \"A BSTRACT\"\n",
    "        m_list = list(re.finditer(r\"\\b{}\\b\".format(r\"\\s*\".join(list(\"abstract\"))), text, flags=re.IGNORECASE))\n",
    "        if len(m_list) > 0:\n",
    "            text = text[:m_list[0].start()]\n",
    "        text = text[:1000]\n",
    "    institutions = [s.capitalize() for s in re.findall(r\"\\@([a-z\\.]+)\\.[a-z]{2,4}\", text, flags=re.IGNORECASE)]\n",
    "    if len(institutions) == 0:\n",
    "        orgs_found = re.findall(r\"|\".join([r\"\\b{}\\b\".format(s) for s in known_orgs]), text, flags=re.IGNORECASE)\n",
    "        if len(set(orgs_found)) == 1:\n",
    "            institutions.append(orgs_found[0].lower().capitalize())\n",
    "    print(arxiv_id, institutions)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3a78a6e6",
   "metadata": {},
   "outputs": [],
   "source": [
    "# do email only in first N characters\n",
    "# if no emails found then look for list of orgs\n",
    "\n",
    "# compare before - after and check if correct"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "52848667",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "bd69ac1e",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "29297f8d",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3c42746e",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "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.8.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
