This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
import pickle | |
import typing as ty | |
from pathlib import Path | |
import networkx as nx | |
from qiskit.circuit.quantumregister import Qubit | |
from qiskit.dagcircuit.dagcircuit import DAGNode | |
logger = logging.getLogger("IBMQHardwareArchitecture") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(setq lsp-keymap-prefix "C-c s") | |
(use-package lsp-mode | |
;;:init | |
:config | |
(setq lsp-enable-snippet nil) | |
;; Python | |
;; Default pyls server when not given in local variables | |
(setq lsp-pyls-server-command '("~/.anaconda3/envs/pyls/bin/pyls")) | |
;; Do not enable the formatters to let pyls use Black! | |
(setq lsp-pyls-plugins-autopep8-enabled nil) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def normalise(vec: numpy.ndarray) -> numpy.ndarray: | |
norm = numpy.linalg.norm(vec) | |
if norm > numpy.finfo(float).eps: | |
return vec / norm | |
return vec | |
def reverse_normalised_kronecker(vec: numpy.ndarray, *sizes: int, under_is_zero: float = 1e-10): | |
"""Reverse a kronecker product of normalised vectors. | |
:param vec: The full vector, result of the kronecker product. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gdb sw 140 17:51:14 | |
GNU gdb (GDB) 8.3 | |
Copyright (C) 2019 Free Software Foundation, Inc. | |
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> | |
This is free software: you are free to change and redistribute it. | |
There is NO WARRANTY, to the extent permitted by law. | |
Type "show copying" and "show warranty" for details. | |
This GDB was configured as "x86_64-pc-linux-gnu". | |
Type "show configuration" for configuration details. | |
For bug reporting instructions, please see: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[notification-center] | |
# Margin at the top of the notification center in pixels. | |
# This can be used to avoid overlap between the notification center and | |
# bars such as polybar or i3blocks. | |
marginTop = 50 | |
# Width of the notification center in pixels. | |
width = 750 | |
# Monitor on which the notification center will be printed. | |
# NOTE: is the "0" value special? Because with this setting, the notification | |
# center appears on the focused monitor. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy | |
from qiskit.mapper._compiling import two_qubit_kak | |
A = numpy.array([[15, 9, 5, -3], [9, 15, 3, -5], [5, 3, 15, -9], [-3, -5, -9, 15]], dtype=numpy.complex) / 4 | |
two_qubit_kak(A) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ====================================================================== | |
# Copyright CERFACS (November 2018) | |
# Contributor: Adrien Suau (suau@cerfacs.fr) | |
# | |
# This software is governed by the CeCILL-B license under French law and | |
# abiding by the rules of distribution of free software. You can use, | |
# modify and/or redistribute the software under the terms of the | |
# CeCILL-B license as circulated by CEA, CNRS and INRIA at the following | |
# URL "http://www.cecill.info". | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ====================================================================== | |
# Copyright CERFACS (November 2018) | |
# Contributor: Adrien Suau (suau@cerfacs.fr) | |
# | |
# This software is governed by the CeCILL-B license under French law and | |
# abiding by the rules of distribution of free software. You can use, | |
# modify and/or redistribute the software under the terms of the | |
# CeCILL-B license as circulated by CEA, CNRS and INRIA at the following | |
# URL "http://www.cecill.info". | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Traceback (most recent call last): | |
File "~/venv/papis/lib64/python3.6/site-packages/prompt_toolkit/application/application.py", line 652, in _run_async2 | |
result = yield f | |
File "~/venv/papis/lib64/python3.6/site-packages/prompt_toolkit/eventloop/coroutine.py", line 86, in step_next | |
new_f = coroutine.send(None) | |
File "~/venv/papis/lib64/python3.6/site-packages/prompt_toolkit/application/application.py", line 595, in _run_async | |
self._redraw() | |
File "~/venv/papis/lib64/python3.6/site-packages/prompt_toolkit/application/application.py", line 444, in _redraw | |
self.renderer.render(self, self.layout) | |
File "~/venv/papis/lib64/python3.6/site-packages/prompt_toolkit/renderer.py", line 590, in render |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import scipy.linalg as la | |
A = .25 * np.array([[15, 9, 5, -3], | |
[9, 15, 3, -5], | |
[5, 3, 15, -9], | |
[-3, -5, -9, 15]]) | |
t0 = 2 * np.pi |
NewerOlder