Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / 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 / 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 / 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 / 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

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:

This is code repository for Quantum Adiabatic Optimization article.

Start by running instance.py that will build list-based definiton of the graph from its set-based definition, this will let you keep consistent indices between all the runs.

The run.py is the adiabatic optimization code.

Energy spectrum can be examined by running eigenenergies.py with single command line argument being one of HMVC, HMVC_, HMIS or HMIS_. I don't suggest running all the diagonalizations in single run, graphs are big and you are likely to get a segmentation fault error. This is why it is good to keep consistent indices and store your graph using lists and not sets.

You can plot figures using plot.py.