This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head><meta charset="utf-8" /> | |
<title>GateNoiseModels</title><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script> | |
<style type="text/css"> | |
/*! | |
* |
This file contains hidden or 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 time_dependent_to_qutip(operator, full_space=None, t=symbols("t", real=True)): | |
import re | |
if t in operator.all_symbols(): | |
operator = operator.expand() | |
if isinstance(operator, OperatorPlus): | |
return [time_dependent_to_qutip(o, full_space) for o in operator.operands] | |
elif isinstance(operator, ScalarTimesOperator): | |
return [operator.term.to_qutip(full_space), | |
re.sub("I", "(1.0j)", str(operator.coeff))] # a bit of a hack to replace imaginary unit | |
return [operator.to_qutip(full_space), "1"] |
This file contains hidden or 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 sympy | |
from collections import defaultdict | |
def walk_exprs(exprs, subexpr=None): | |
""" | |
Return a dict {expr: frequency} for all subexpressions in the sequence of expressions `expr`. | |
""" | |
if subexpr is None: | |
subexpr = defaultdict(int) | |
for e in exprs: |
This file contains hidden or 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
set nocompatible " Fuck VI... That's for grandpas. | |
filetype off | |
set rtp+=~/.vim/bundle/vundle/ | |
call vundle#rc() | |
" Vundle let's you specify a plugin in a number of formats, but my favorite | |
" allows you to grab plugins straight off of github, just specify the bundle | |
" in the following format: | |
" Bundle 'githubUsername/repoName' |
This file contains hidden or 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
diff --git a/src/configure.in b/src/configure.in | |
index e57be41..7606d1f 100644 | |
--- a/src/configure.in | |
+++ b/src/configure.in | |
@@ -1011,9 +1011,14 @@ AC_ARG_ENABLE(pythoninterp, | |
[enable_pythoninterp="no"]) | |
AC_MSG_RESULT($enable_pythoninterp) | |
if test "$enable_pythoninterp" = "yes" -o "$enable_pythoninterp" = "dynamic"; then | |
- dnl -- find the python executable | |
- AC_PATH_PROGS(vi_cv_path_python, python2 python) |
This file contains hidden or 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 qnet.circuit_algebra as ca | |
import sympy | |
Q = ca.local_space('Q') | |
a = ca.Destroy(Q) | |
Delta, kappa = sympy.symbols('Delta, kappa', real = True) | |
H = Delta * a.dag() * a | |
L = ca.Matrix(ca.sqrt(Delta) * a) | |
S = ca.identity_matrix(1) | |
cavity_model = ca.SLH(S, L, H) |