Skip to content

Instantly share code, notes, and snippets.

@GM3D
GM3D / 2212.12372 H5C check.ipynb
Last active January 9, 2023 00:55
Documents/Papers/2212.12372 H5C check.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@GM3D
GM3D / Reflection coefficient in Drude theory.ipynb
Last active September 8, 2021 06:12
Reflection coefficient in Drude theory.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@GM3D
GM3D / Beta distribution.ipynb
Created June 8, 2020 13:12
Google ドライブ/Jupyter Notebooks/Beta distribution.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@GM3D
GM3D / nielsen-chuang-exercise-5.17.py
Last active December 14, 2021 15:27
A code to describe the algorithm in Nielsen-Chuang exercise 5.17.
import math as m
def pure_power(N):
"""checks if N is a pure power, i. e. N = a^b for some integers
a >=1, b >= 2.
returns (a, b) if a and b are found.
returns (N, 1) if N is not a pure power.
See ref.1.: https://en.wikipedia.org/wiki/
Computational_complexity_of_mathematical_operations#Elementary_functions
for the computational complexities for each element.
@GM3D
GM3D / exercise-I-2-2.py
Last active October 2, 2017 07:59
Coursera Modular forms 2017 exercise I-2-2
#!/usr/bin/python3
from math import sqrt, factorial
from operator import mul
def binomial(n, k):
return factorial(n)/(factorial(n-k) * factorial(k))
def dot_prod(a, b):
return sum(map(mul, a, b))