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

Revision 7aceb7c332ec553625445ad6e67b25559dbdf212 authored by ali@mingzhe-1.cs.uchicago.edu on 26 January 2017, 07:12:43 UTC, committed by ali@mingzhe-1.cs.uchicago.edu on 26 January 2017, 07:12:43 UTC
rotation precision mods
1 parent 8510491
  • Files
  • Changes
  • ae7f22c
  • /
  • scaffold.sh
Raw File Download

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.

  • revision
  • directory
  • content
revision badge
swh:1:rev:7aceb7c332ec553625445ad6e67b25559dbdf212
directory badge
swh:1:dir:ae7f22c4b55a5f43c756066462e6c469f99f5331
content badge
swh:1:cnt:d5c3ac9218320b6b6c568057d13e8e4aac5179b5

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.

  • revision
  • directory
  • content
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
scaffold.sh
#!/bin/bash 

ROOT=$(dirname $0)

# Get CTQG path
export CTQG_PATH=${ROOT}/ctqg/CTQG
if [ $(echo $PATH | grep ${CTQG_PATH} | wc -l) -eq 0 ]; then
	export PATH=$PATH:$CTQG_PATH
fi

function show_help {
    echo "Usage: $0 [-h] [-rqfRTFcpd] [-l #] [-P #] <filename>.scaffold"
    echo "    -r   Generate resource estimate (default)"
    echo "    -q   Generate QASM"
    echo "    -f   Generate flattened QASM"
    echo "    -R   Disable rotation decomposition"
    echo "    -T   Disable Toffoli decomposition"    
	  echo "    -l   Levels of recursion to run (default=1)"
    echo "    -P   Set precision of rotation decomposition in decimal digits (default=10)"        
    echo "    -F   Force running all steps"
    echo "    -c   Clean all files (no other actions)"
    echo "    -p   Purge all intermediate files (preserves specified output,"
    echo "         but requires recompilation for any new output)"
    echo "    -d   Dry-run; show all commands to be run, but do not execute"
}

# Parse opts
OPTIND=1         # Reset in case getopts has been used previously in the shell.
ctqg=0
clean=0
dryrun=""
force=0
purge=0
res=0
rot=1
toff=1
targets=""
precision=4
while getopts "h?cdfFpqrRT:l:P:" opt; do
    case "$opt" in
    h|\?)
        show_help
        exit 0
        ;;
    c) clean=1
        ;;
	  d) dryrun="--dry-run"
		    ;;
    F) force=1
        ;;
    f) targets="${targets} flat"
        ;;
    p) purge=1
        ;;
    q) targets="${targets} qasm"
        ;;
    r) res=1
        ;;
    R) rot=0
        ;;
    T) toff=0
        ;;        
    l) targets="${targets} SQCT_LEVELS=${OPTARG}"
        ;;
    P) precision=${OPTARG}
    esac
done
shift $((OPTIND-1))
[ "$1" = "--" ] && shift

# Put resources at the end so it is easy to read
if [ ${res} -eq 1 ]; then
    targets="${targets} resources"
fi
# Don't purge until done
if [ ${purge} -eq 1 ]; then
    targets="${targets} purge"
fi
# Force first
if [ ${force} -eq 1 ]; then
    targets="clean ${targets}"
fi
# Default to resource estimate
if [ -z "${targets}" ]; then
    targets="resources"
fi

if [ $# -lt 1 ]; then 
    echo "Error: Missing filename argument" 
    show_help 
    exit 1 
fi 

filename=${1}
if [ ! -e ${filename} ]; then
    echo "${filename}: file not found"
    show_help
    exit 1
fi
dir="$(dirname ${filename})/"
file=$(basename ${filename} .scaffold)
cfile="${file}.*"

if [ $(egrep '^ctqg.*{\s*' ${filename} | wc -l) -gt 0 ]; then
	ctqg=1
	toff=1
	#dir=""
fi

if [ ${clean} -eq 1 ]; then
	make -f $ROOT/scaffold/Scaffold.makefile ${dryrun} ROOT=$ROOT DIRNAME=${dir} FILENAME=${filename} FILE=${file} CFILE=${cfile} clean
    exit
fi
make -f $ROOT/scaffold/Scaffold.makefile ${dryrun} ROOT=$ROOT DIRNAME=${dir} FILENAME=${filename} FILE=${file} CFILE=${cfile} TOFF=${toff} CTQG=${ctqg} ROTATIONS=${rot} PRECISION=${precision} ${targets}

exit 0

The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

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