Skip to content

Instantly share code, notes, and snippets.

View gyu-don's full-sized avatar

Takumi Kato gyu-don

  • Japan
View GitHub Profile
@gyu-don
gyu-don / OneWeekJuliaChapter7.ipynb
Created February 21, 2024 15:58
1週間で学べるJulia数値計算プログラミング 7.2〜7.3
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gyu-don
gyu-don / maze-problem-stream.py
Last active June 13, 2023 15:29
迷路最短経路を無限(かもしれない)リストを使って
# https://yosh.hateblo.jp/entries/2010/01/19#p1
# http://okajima.air-nifty.com/b/2010/01/post-abc6.html
from dataclasses import dataclass
from typing import NamedTuple, TextIO
from io import StringIO
from collections import deque
class Point(NamedTuple):
x: int
@gyu-don
gyu-don / maze-problem.py
Created June 13, 2023 14:48
迷路最短経路
# https://yosh.hateblo.jp/entries/2010/01/19#p1
# http://okajima.air-nifty.com/b/2010/01/post-abc6.html
from dataclasses import dataclass
from typing import NamedTuple, TextIO
from io import StringIO
class Point(NamedTuple):
x: int
y: int
@gyu-don
gyu-don / 離散ヤング実験.ipynb
Last active December 29, 2022 07:14
量子ビットの言葉でのヤングの実験
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gyu-don
gyu-don / qgate_backend.py
Created April 17, 2022 03:59
blueqatのqgate_backend. なくなって困る人用。
from collections import Counter
import math
from typing import Any, List, Optional
import numpy as np
from .backendbase import Backend
import blueqat.gate as bqgate
class _U3(bqgate.OneQubitGate):
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gyu-don
gyu-don / 爆弾検査問題.ipynb
Created March 3, 2020 05:15
爆弾検査問題をもっとやってみた
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gyu-don
gyu-don / concat_is_monad.v
Last active February 22, 2020 11:26
リストのリストをリストにするやつがモナドであることを示しました。
Require Import List.
Import ListNotations.
Theorem concat_assoc(X: Type):
forall tttx: list (list (list X)), (concat (concat tttx)) = (concat (map (@concat X) tttx)).
Proof.
intros.
induction tttx.
simpl. reflexivity.
simpl. rewrite <- IHtttx. apply concat_app.
from blueqat import Circuit, pauli, vqe
from blueqat.pauli import qubo_bit as q
from math import pi
import numpy as np
def an(index):
return 0.5 * pauli.X[index] + 0.5j * pauli.Y[index]
def cr(index):
return 0.5 * pauli.X[index] - 0.5j * pauli.Y[index]
@gyu-don
gyu-don / chap3.v
Created September 30, 2019 03:43
Coq/SSReflect/MathComp Chapter 3
(* 3.1 *)
Inductive 紅白玉 :=
| 赤玉
| 白玉.
(* 3.2 *)
Print list.
(*
Inductive list (A : Type) : Type :=
nil : list A