Skip to content

Instantly share code, notes, and snippets.

View nelimee's full-sized avatar

Adrien Suau nelimee

View GitHub Profile
@nelimee
nelimee / measurement_error_validation.py
Created June 25, 2018 08:41
A quantum program to validate the provided errors with an experiment on the real backend.
import Qconfig
import qiskit
import numpy as np
qiskit.register(Qconfig.APItoken, Qconfig.config["url"])
ibmqx4 = qiskit.get_backend('ibmqx4')
qubit_number = ibmqx4.configuration['n_qubits']
shot_number = 8192
// Quantum circuit to illustrate issue #1
// of https://github.com/nelimeee/qasm2error
OPENQASM 2.0;
include "qelib1.inc";
// A quantum gate that applies 10 times non-simplifiable
// gates to the given qubit
gate g10 q {
y q;
@nelimee
nelimee / QISKit_issue_593.py
Created June 22, 2018 13:59
A script to illustrate the issue 593 of QISKit
# ======================================================================
# Copyright CERFACS (February 2018)
# Contributor: Adrien Suau (suau@cerfacs.fr)
#
# This software is governed by the CeCILL-B license under French law and
# abiding by the rules of distribution of free software. You can use,
# modify and/or redistribute the software under the terms of the
# CeCILL-B license as circulated by CEA, CNRS and INRIA at the following
# URL "http://www.cecill.info".
#
@nelimee
nelimee / 4x4.qasm
Created June 22, 2018 13:56
A quantum circuit that illustrate an issue in QISKit
// ======================================================================
// Copyright CERFACS (February 2018)
// Contributor: Adrien Suau (suau@cerfacs.fr)
//
// This software is governed by the CeCILL-B license under French law and
// abiding by the rules of distribution of free software. You can use,
// modify and/or redistribute the software under the terms of the
// CeCILL-B license as circulated by CEA, CNRS and INRIA at the following
// URL "http://www.cecill.info".
//
@nelimee
nelimee / qiskit_gate_idea.py
Created March 30, 2018 08:02
An implementation idea for the Gate hierarchy of QISKit
# Base class for each gate
class Gate:
def __init__(self, name: str, qubits):
self._name = name
if isinstance(qubits, list):
self._qubits = qubits
else:
self._qubits = [qubits]
def qasm(self) -> str: