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
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? |
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
🏁 🍇 | |
👴 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 |
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
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) { |