Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/epiqc/ScaffCC
06 August 2026, 17:21:47 UTC
  • Code
  • Branches (10)
  • Releases (1)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/ScaffCC_OSX
    • refs/heads/master
    • refs/tags/2.2
    • refs/tags/5.0
    • refs/tags/v1.0
    • refs/tags/v1.0-beta.2
    • refs/tags/v2.0
    • refs/tags/v2.1
    • refs/tags/v3.0
    • refs/tags/v4.0
    • v3.1
  • 521ea40
  • /
  • docs
  • /
  • ch-usage
  • /
  • chapter-usage.tex
Raw File Download Save again
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
  • release
origin badgecontent badge
swh:1:cnt:36135ec3f1438e4e7f0737da4450b640237b98f9
origin badgedirectory badge
swh:1:dir:fe2abe4e8bbe4d1adbfa608de30c74e6f227d590
origin badgerevision badge
swh:1:rev:861c8b60980b0f4d36b101b45346a2e64b0fa390
origin badgesnapshot badge
swh:1:snp:7eb50f12cf990a0030724453139e994df238639f
origin badgerelease badge
swh:1:rel:e918b85405a8e82ed65a32ac3ebbd92371a551e7

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
  • release
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
Tip revision: 861c8b60980b0f4d36b101b45346a2e64b0fa390 authored by Pranav Gokhale on 05 February 2018, 05:29:11 UTC
update documentation and release notes
Tip revision: 861c8b6
chapter-usage.tex
\chapter{Using ScaffCC}\label{ch:usage}

\section{Running the Compiler}
To run the compiler, simply use the `scaffold.sh' script in the main directory, with the name of the program and optional compiler flags.

\subsection{Basic Example:}

The command below runs the compiler with default options on the Binary Welded Tree algorithm, with n=100 and s=100 as problem sizes.
The default compiler option is to generate resource estimations (number of qubits and gates).

\begin{lstlisting}
./scaffold.sh Algorithms/Binary Welded Tree/Binary_Welded_Tree_n100s100.scaffold
\end{lstlisting}


\section{Compiler Options}
To see a list of compiler options which can be passed as flags, run:

\begin{lstlisting}
./scaffold.sh -h

Usage: ./scaffold.sh [-hv] [-rqfRFckdso] [-l #] [-P #] <filename>.scaffold
    -r   Generate resource estimate (default)
    -q   Generate QASM
    -f   Generate flattened QASM
    -b   Generate OpenQASM
    -R   Disable rotation decomposition
    -T   Disable Toffoli decomposition
    -l   Levels of recursion to run (default=1)
    -P   Set precision of rotation decomposition in decimal digits (default=10)
    -F   Force running all steps
    -c   Clean all files (no other actions)
    -k   Keep all intermediate files (default only keeps specified output,
         but requires recompilation for any new output)
    -d   Dry-run; show all commands to be run, but do not execute
    -s   Generate QX Simulator input file 
    -o   Generate optimized QASM
    -v   Show current ScaffCC version
\end{lstlisting}



\section{Sample Scripts}
This section describes some of the example scripts contained in the `scripts/' directory. They are written to test the various functionalities 
of ScaffCC, as detailed below.

Each of them automates the process of running multiple compiler passes on an input file to perform the required analysis or optimization.


\subsection{Generating LLVM Intermediate Format: ./gen-ll.sh}

Lowers .scaffold source file to .ll file (intermediary LLVM format). Creates \textless algorithm\textgreater.ll
The .ll file is the main file in LLVM on which all transformations, optimizations and analysis are performed.


\subsection{Critical Path Estimation: ./gen-cp.sh}

Finds critical path information for several different flattening thresholds by doing the following:
\begin{enumerate}
\item Finding module sizes using the ResourceCount2 pass.
\item Flattening modules based on the found module sizes and the requested threshold.
\item Finds length of critical path, in terms of number of operations on it. Look for the number in front of "main" in the output. 
\end{enumerate}

\subsubsection{flattening\_thresh.py} 
Divides modules into different buckets based on their size, to be used for flattening decision purposes.


\subsection{Module Call Frequency Estimation: ./gen-freq-estimate.sh}
Generates an estimate of how many times each module is called, which can guide flattening decisions.


\subsection{Generate Longest-Path-First-Schedule (LPFS): ./gen-lpfs.sh}
Generates LPFS schedules with different options as specified below.

Options in the script: 
  K=number of SIMD regions / D=capacity of each region / th=flattening thresholds

Calls the following scripts:
  
  \subsubsection{./regress.sh}
  
  Runs the 3 different communication-aware schedulers, LPFS, RCP, SS, with different scheduler configurations.
  Look in ./sched.pl for configuration options. For example using -m gives metrics only, while -s outputs entire schedule.

  \subsubsection{./sched.pl}
  The main scheduler code for LPFS and RCP.

  \subsubsection{./comm\_aware.pl}
  Applies the communication penalty to timesteps.

All output files are placed in a new directory to avoid cluttering.

\subsection{Rotation Generator: gen\_rotation/}

This is a C++ implemetation of the library construction method for generating Rz rotations. The main features of this generator include: 
\begin{itemize}
\item Powered by gridsynth, the package can generate rotation sequences that approximate arbitrary $Rz$ angles, up to given precision. 
\item Generate libraries of rotation sequences given use-defined precision and storage requirements, trading storage for execution time. 
\item Dynamically concatenate rotation sequences at run time using generated libraries.
\end{itemize}
Detailed description and usage can be found in the subdirectory scripts/gen\_rotations/.


\subsection{Test Correctness of RKQC Programs: RKQCVerifier/}

RKQCVerifier is a tool that helps verify the correctness of RKQC applications. For detailed description and usage, please refer to the subdirectory scripts/RKQCVerifier/.

\subsection{Braidflash}

Braidflash is a software for efficient simulation of braids in the context of surface error correction of quantum applications. For further explanation and to cite this tool, please refer to the following publication:

\begin{quote}
A. Javadi-Abhari, P. Gokhale, A. Holmes, D. Franklin, K. R. Brown, M. R. Martonosi, F. T. Chong, {\em``Optimized Surface Code Communication in Superconducting Quantum Computers,"} IEEE/ACM MICRO, Cambridge, MA, 2017
\end{quote}

Detailed description and usage can be found in the subdirectory braidflash/.

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API