Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am marekyggdrasil on github.
  • I am renzokuken (https://keybase.io/renzokuken) on keybase.
  • I have a public key ASBlmYD61f2p1NbjpbpO7pCJH_4zOEmIbMry26gc4P7lIAo

To claim this, I am signing this object:

@marekyggdrasil
marekyggdrasil / figure.png
Last active April 2, 2020 13:47
An example how to simulate measurement with QuTip, an answer to https://quantumcomputing.stackexchange.com/a/11379/8883
figure.png
@marekyggdrasil
marekyggdrasil / outcomes.png
Last active July 9, 2021 06:00
A brief tutorial how to simulate quantum teleportation with QuTip quantum computing library in Python. More detailed explanation available here: http://mareknarozniak.com/2020/03/22/simulating-quantum-teleportation/
outcomes.png
@marekyggdrasil
marekyggdrasil / plot_file_a.png
Last active December 2, 2019 01:57
Inconsistent Matplotlib behaviour, running script multiple times leads to different outcomes. Posted as question on StackOverflow under URL: https://stackoverflow.com/questions/59101292/matplotlib-randomly-ignored-passed-parameters-at-each-execution
plot_file_a.png
@marekyggdrasil
marekyggdrasil / res_circuit.png
Last active November 13, 2019 10:40
Quantum random generation implemented with IBM Q's AER results with non-even distribution even without noise model. Opened issue is: https://github.com/Qiskit/qiskit-aer/issues/437
res_circuit.png
@marekyggdrasil
marekyggdrasil / berendsen_temperature.xvg
Created October 31, 2019 04:46
Calculating histograms from GROMACS xvg files using Python
# This file was created Wed Oct 30 15:12:39 2019
# Created by:
# :-) GROMACS - gmx energy, 2018 (-:
#
# Executable: /gpfsnyu/packages/gromacs/gnu/2018/bin/gmx
# Data prefix: /gpfsnyu/packages/gromacs/gnu/2018
# Working dir: /gpfsnyu/home/mmn362/CompChem/Practicum3/Step10b
# Command line:
# gmx energy -f md.edr -o berendsen_temperature.xvg
# gmx energy is part of G R O M A C S:
@marekyggdrasil
marekyggdrasil / out.txt
Last active October 25, 2019 02:44
Creating step-based tests in Python with alternative execution paths. In this example we want to perform a test which always starts with `step_a` and always ends with `step_d` but in the middle can take either `step_b` and `step_c` either alternative steps. We test if final number is `12` and it can be obtained as `3*4=12` or `2*6=12` and those …
$ python -m pytest run.py -vvv
============================= test session starts ==============================
platform darwin -- Python 3.5.3, pytest-4.2.0, py-1.8.0, pluggy-0.12.0 -- /Users/marek/.pyenv/versions/3.5.3/bin/python
cachedir: .pytest_cache
rootdir: /Users/marek/Development/qtl/36a5d4cb5674e14792b03b4f79b89402, inifile:
plugins: steps-1.6.4, timeout-1.3.3, flaky-3.6.1
collected 8 items
braids_test.py::test_scenario_1[step_a] PASSED [ 12%]
braids_test.py::test_scenario_1[step_b] PASSED [ 25%]
@marekyggdrasil
marekyggdrasil / data1.p
Last active November 7, 2019 05:20
(1) keep increasing xi (2) for every xi increase nmax to nmax + 1 and expect same spectrum
@marekyggdrasil
marekyggdrasil / run.py
Created May 14, 2019 08:21
(1) keep increasing xi (2) for every xi increase nmax to nmax + 1 and expect same spectrum
( todo )
@marekyggdrasil
marekyggdrasil / example.py
Last active May 2, 2019 04:35
I encountered a problem related to usage of lambda functions to pass extra arguments to initial value problem solved from SciPy while used inside of Jupyter notebook environment. Perhaps someone more experienced with Jupyter could help out in the comments.
from scipy.integrate import solve_ivp
import numpy as np
def exponential_decay(t, y, alpha, beta): return -alpha*y + beta
for alpha in np.linspace(0.5, 0.7, 5) :
beta = 1.
sol = solve_ivp(lambda t, y: exponential_decay(t, y, alpha, beta), [0, 10], [2, 4, 8])