Skip to content

Instantly share code, notes, and snippets.

View ericvoorhis's full-sized avatar
🤪

Eric Voorhis ericvoorhis

🤪
View GitHub Profile
@ericvoorhis
ericvoorhis / grover_qutip.py
Created May 5, 2018 06:13 — forked from CatherineH/grover_qutip.py
Grover's search in qutip
from random import randint
import matplotlib.pyplot as plt
from matplotlib.ticker import FormatStrFormatter
from qutip import tensor, basis, hadamard_transform, identity
# initialize the |0> and |1> qubit states
zero = basis(2, 0)
one = basis(2, 1)
# how many times have we applied the oracle and diffuser?
@ericvoorhis
ericvoorhis / gcd.emojic
Last active August 13, 2022 21:52
An emojicode (https://github.com/emojicode/emojicode) program for computing the greatest common divisor of two given integers
🏁 🍇
👴 I used the following wiki page as a reference:
👴 https://simple.wikipedia.org/wiki/Euclidean_algorithm
👴 The following callable (What emojicode calls functions) named gcd
👴 takes two integers a and b (each of type 🚂 or better known as "int")
👴 and returns (➡️) the greatest common divisor between them.
🍦 gcd 🍇 a🚂 b🚂 ➡️ 🚂
🍮 m a
🍮 n b
@ericvoorhis
ericvoorhis / EndtimesCrowdsale.sol
Created December 12, 2017 23:22 — forked from endtimesnetwork/EndtimesCrowdsale.sol
Endtimes Crowdsale Contract
pragma solidity 0.4.17;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {