Skip to content

Instantly share code, notes, and snippets.

Avatar

Marek marekyggdrasil

View GitHub Profile
@marekyggdrasil
marekyggdrasil / phi1.cnf
Last active Jul 13, 2020
CNF files for online tutorial covering the concept of SAT and boolean satisfiability in general, tutorial available under https://mareknarozniak.com/2020/07/13/satisfiability/
View phi1.cnf
p cnf 3 3
1 -2 3 0
1 2 -3 0
-1 -2 3 0
@marekyggdrasil
marekyggdrasil / diophantine.py
Last active Jun 25, 2020
Code repository for tutorial on constraint programming available on https://mareknarozniak.com/2020/06/22/constraint-programming/
View diophantine.py
from constraint import Problem
problem = Problem()
problem.addVariable('x', range(1, 10))
problem.addVariable('y', range(1, 10))
problem.addVariable('z', range(1, 10))
def constraintCheck(x, y, z):
@marekyggdrasil
marekyggdrasil / run_rtsp_raw.py
Created May 28, 2020
An example of a raw livestream pipeline generated from numpy array, based on https://github.com/jackersson/gstreamer-python/commit/98424f8c21bd84805313d8890d789e739d115ffa and to put it in context, I made this example for this issue https://github.com/jackersson/gst-python-tutorials/issues/4
View run_rtsp_raw.py
#!/usr/bin/env python
# -*- coding:utf-8 vi:ts=4:noexpandtab
# Simple RTSP server. Run as-is or with a command-line to replace the default pipeline
import time
import sys
import abc
import numpy as np
import typing as typ
from fractions import Fraction
View README.md

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.

View keybase.md

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 / teleport.py
Last active Mar 22, 2020
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/
View teleport.py
import numpy as np
import itertools
from qutip import basis, tensor, rand_ket, snot, cnot, rx, rz, qeye
# create random state
psi = rand_ket(2)
# initial state
@marekyggdrasil
marekyggdrasil / plot_file_a.png
Last active Dec 2, 2019
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
@marekyggdrasil
marekyggdrasil / res_circuit.png
Last active Nov 13, 2019
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
You can’t perform that action at this time.