Skip to content

Instantly share code, notes, and snippets.

View jond01's full-sized avatar

Jonathan Daniel jond01

  • 17:06 (UTC +03:00)
View GitHub Profile

macOS Setup

This document lists what should be installed on a clean macOS for the best software development experience.

Browser

Chrome:
https://www.google.com/chrome/

Extensions

Vimium:

@jond01
jond01 / git-tag.sh
Created May 24, 2023 18:20
Tagging revisions with Git
# Make an annotated, GPG-signed tag
git tag -s 0.1.0 -m "Version 0.1.0" -m "Another message line"
# List the tags (up to 10 lines)
git tag -n10
# https://git-scm.com/docs/git-tag
@jond01
jond01 / set-git.sh
Last active May 31, 2023 09:56
Setting up Git properly including GPG and signatures
# Configure default name and email
git config --global user.name "<Firstname> <Surname>"
git config --global user.email <email>
# Sign commits by default
git config --global commit.gpgSign true
# Sign tags by default
git config --global tag.gpgSign true
@jond01
jond01 / ResourcesEstimator.cs
Last active June 10, 2022 07:48
Examine Q#'s trace simulator via an analysis of the `CCNOT` operation.
using System;
using System.Threading.Tasks;
using System.Collections.Generic;
using Microsoft.Quantum.Simulation.Simulators.QCTraceSimulators;
using TestTraceSimulator;
namespace host
{
static class Program
{
@jond01
jond01 / TestExp.qs
Last active June 8, 2022 20:39
Test the `Exp` operation implementation in Q#.
namespace TestExp {
open Microsoft.Quantum.Intrinsic;
open Microsoft.Quantum.Math;
open Microsoft.Quantum.Arrays;
open Microsoft.Quantum.Diagnostics;
// A shortened version of the `Exp` operation when all the Paulis are
// `PauliZ`:
// https://github.com/microsoft/qsharp-runtime/blob/70c881d8b93f290bca6145fb5fda28e5dbc57827/src/Simulation/TargetDefinitions/Decompositions/ExpFromExpUtil.qs#L25-L40
operation MyExpZ(theta : Double, qubits : Qubit[]) : Unit is Adj + Ctl {

Note - the latest version of the post is available on:
https://jond01.github.io/blog/expressing-quantum-programs-in-qsharp-and-openqasm

Expressing Quantum Programs in Q# and OpenQASM

Jonathan Daniel, 5 December 2021.

With the rising popularity of quantum computing over the past years, open-source frameworks for developing quantum programs mature and form substantial ecosystems around them. Microsoft's Quantum Development Kit (QDK) and Qiskit by IBM are two major open-source frameworks. They present different approaches and tools for developing quantum algorithms and executing them on simulators or quantum hardware. However, since their goal and audience overlap, the two frameworks share many similarities. This blog post focuses on the main quantum programming languages of the two frameworks: Q# (QDK) and OpenQASM (Qiskit).

@jond01
jond01 / U_gate_Q#_parser.ipynb
Last active July 21, 2021 16:24
Compare qsharp-integrations translated U gate (in Q#) with Qiskit's U gate (QASM)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jond01
jond01 / U_gate.ipynb
Last active June 8, 2022 20:44
Compare the two definitions of qiskit's U gate
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jond01
jond01 / itk_dcm_orientations.py
Last active June 19, 2021 21:43
itk_dcm_orientations
import os
import itk
import numpy as np
import pandas as pd
from orientations_utils import ornt_list, ornt_direction_dict, is_right_handed_ornt, direction2ornt
from itk_utils import set_image_direction, get_image_direction
@jond01
jond01 / huji_ap.py
Created February 19, 2018 19:39
Complete data on HUJI avnei pina courses, using python
'''
python 3 script for adding day in week and hours data from shnaton
to each of avnei pina (ap) courses (HUJI)
The script output is both html table and xlsx file
author: Jonathan Daniel
Oct-2017
'''
import requests
from bs4 import BeautifulSoup
import pandas as pd