From a41684027e74089d4a06b2b086bab40141574594 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Apr 2024 17:40:31 -0400 Subject: [PATCH 1/2] Bump github/codeql-action from 2 to 3 (#237) * Bump github/codeql-action from 2 to 3 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2 to 3. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/v2...v3) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Aleksandr (Sasha) Berezutskii --- .github/workflows/codeql-analysis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 7afcabbb..9eadd318 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -31,7 +31,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -45,7 +45,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v2 + uses: github/codeql-action/autobuild@v3 # ℹī¸ Command-line programs to run using the OS shell. # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun @@ -58,4 +58,4 @@ jobs: # ./location_of_script_within_repo/buildscript.sh - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 From 896200727eae49815c925bf57e0bd83ed9805789 Mon Sep 17 00:00:00 2001 From: "Aleksandr (Sasha) Berezutskii" Date: Tue, 16 Apr 2024 18:30:24 -0400 Subject: [PATCH 2/2] update examples --- examples/decoding/failing_svd.ipynb | 151 ---------------------------- 1 file changed, 151 deletions(-) delete mode 100644 examples/decoding/failing_svd.ipynb diff --git a/examples/decoding/failing_svd.ipynb b/examples/decoding/failing_svd.ipynb deleted file mode 100644 index 33ce4a9d..00000000 --- a/examples/decoding/failing_svd.ipynb +++ /dev/null @@ -1,151 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import numpy as np\n", - "import qecstruct as qec\n", - "import matplotlib.pyplot as plt\n", - "from mdopt.optimiser.utils import (\n", - " ConstraintString,\n", - " IDENTITY,\n", - " SWAP,\n", - " XOR_BULK,\n", - " XOR_LEFT,\n", - " XOR_RIGHT,\n", - ")\n", - "from examples.decoding.decoding import (\n", - " linear_code_constraint_sites,\n", - " linear_code_prepare_message,\n", - " linear_code_codewords,\n", - ")\n", - "from examples.decoding.decoding import (\n", - " apply_bitflip_bias,\n", - " apply_constraints,\n", - " decode_linear,\n", - ")\n", - "from mdopt.mps.utils import (\n", - " create_simple_product_state,\n", - " create_custom_product_state,\n", - ")\n", - "from mdopt.utils.utils import mpo_to_matrix" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "failures_statistics = {}\n", - "failures = []\n", - "\n", - "SEED = 1964\n", - "NUM_BITS = 16\n", - "PROB_ERROR = 0.1\n", - "CHECK_DEGREE, BIT_DEGREE = 4, 3\n", - "NUM_CHECKS = int(BIT_DEGREE * NUM_BITS / CHECK_DEGREE)\n", - "if NUM_BITS / NUM_CHECKS != CHECK_DEGREE / BIT_DEGREE:\n", - " raise ValueError(\"The Tanner graph of the code must be bipartite.\")\n", - "\n", - "PROB_BIAS = PROB_ERROR\n", - "\n", - "CHI_MAX_CONTRACTOR = 128\n", - "CHI_MAX_DMRG = 128\n", - "CUT = 1e-12\n", - "NUM_RUNS = 1\n", - "\n", - "code = qec.random_regular_code(\n", - " NUM_BITS, NUM_CHECKS, BIT_DEGREE, CHECK_DEGREE, qec.Rng(SEED)\n", - ")\n", - "code_constraint_sites = linear_code_constraint_sites(code)\n", - "INITIAL_CODEWORD, PERTURBED_CODEWORD = linear_code_prepare_message(\n", - " code, PROB_ERROR, error_model=qec.BinarySymmetricChannel, seed=SEED\n", - ")\n", - "tensors = [XOR_LEFT, XOR_BULK, SWAP, XOR_RIGHT]\n", - "\n", - "initial_codeword_state = create_custom_product_state(\n", - " INITIAL_CODEWORD, form=\"Right-canonical\"\n", - ")\n", - "perturbed_codeword_state = create_custom_product_state(\n", - " PERTURBED_CODEWORD, form=\"Right-canonical\"\n", - ")\n", - "\n", - "perturbed_codeword_state = apply_bitflip_bias(\n", - " mps=perturbed_codeword_state,\n", - " sites_to_bias=\"All\",\n", - " prob_bias_list=PROB_BIAS,\n", - " renormalise=True,\n", - " result_to_explicit=False,\n", - ")" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# bond dims and entropy vs time\n", - "# check codewords" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "perturbed_codeword_state = apply_constraints(\n", - " perturbed_codeword_state,\n", - " code_constraint_sites,\n", - " tensors,\n", - " chi_max=CHI_MAX_CONTRACTOR,\n", - " renormalise=True,\n", - " result_to_explicit=False,\n", - " strategy=\"Naive\",\n", - " silent=True,\n", - ")" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "mdopt-ZdbamFdU-py3.11", - "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.11.5" - }, - "orig_nbformat": 4 - }, - "nbformat": 4, - "nbformat_minor": 2 -}