Quick Start Guide¶
cssfinder
installation
This guide will help you get started with the cssfinder
library. Before you
begin, make sure you have cssfinder
installed. If you haven't installed it
yet, you can do so by following the instructions on the
official website.
Example #1¶
Prerequisites
This example relies on cssfinder_backend_numpy
, please install it before continuing,
to avoid problems with running the example.
Clone project¶
CSSFinder comes with a set of examples which can be used to get familiar with the library. To list all available examples, use following command:
Output should look similar to this:
We will use 5qubits_json
example in this tutorial. To clone this example to
current working directory, use following command:
Command output on Linux should look similar to this:
Found example 'e5qubits_json', 'Krzysztof Wiśniewski; Marcin Wieśniak', 'c317ef12'
Cloned example to '/home/argmaster/dev/repos/cssfinder'
As result, you should find that 5qubits_json
directory have been created in
your current working directory. This directory contains project configuration
files which describe tasks to execute. Configuration also specifies how tasks
should be run.
Let's check it by listing content of 5qubits_json
directory:
Ouput should look similar to this:
Inspect project¶
To check contents of the you can use following command:
Output should look similar to this:
Output shows that there are two tasks defined within the project. You can get more information about tasks using following command:
Output should look similar to this:
{
"main": {
"gilbert": {
"mode": "FSnQd",
"backend": {
"name": "numpy",
"precision": "single"
},
"state": {
"file": "/home/argmaster/dev/repos/cssfinder/guide/5qubits_json/5qubits_in.mtx",
"depth": null,
"quantity": null
},
"runtime": {
"visibility": 0.4,
"max_epochs": 1000,
"iters_per_epoch": 2000,
"max_corrections": 1000
},
"resources": {
"symmetries": null,
"projection": null
}
}
}
}
"main"
is a task utilizing gilbert algorithm. It uses numpy
backend with
single
precision floating point numbers (32-bit). Path to matrix file is
expands to
"/home/argmaster/dev/repos/cssfinder/guide/5qubits_json/5qubits_in.mtx"
on PC
of the author of this tutorial. You should see path to 5qubits_in.mtx
file in
your output too, likely preceded by different path.
Run tasks¶
Now we can proceed with running tasks defined within the project. That can be achieved with following command:
This command will run task called "main"
, which may take something in between
of few seconds and few minutes, depending on your hardware. On AMD Ryzen 9
7950X it takes approximately 30 seconds.
After the task is finished, we can check it output directory was created:
As you can see output
directory was indeed created:
total 20
drwxrwxr-x 3 argmaster argmaster 4096 Apr 15 22:20 .
drwxrwxr-x 4 argmaster argmaster 4096 Apr 15 20:47 ..
-rw-rw-r-- 1 argmaster argmaster 1192 Apr 15 20:47 5qubits_in.mtx
-rw-rw-r-- 1 argmaster argmaster 1819 Apr 15 20:47 cssfproject.json
drwxrwxr-x 3 argmaster argmaster 4096 Apr 15 22:20 output
As you can see output
directory was indeed created:
total 20
drwxrwxr-x 3 argmaster argmaster 4096 Apr 15 22:20 .
drwxrwxr-x 4 argmaster argmaster 4096 Apr 15 20:47 ..
-rw-rw-r-- 1 argmaster argmaster 1192 Apr 15 20:47 5qubits_in.mtx
-rw-rw-r-- 1 argmaster argmaster 1819 Apr 15 20:47 cssfproject.json
drwxrwxr-x 3 argmaster argmaster 4096 Apr 15 22:20 output
Now we can check contents of the output
directory:
Within output
directory you should find main
directory (name will match
name of the task):
Let's now inspect contents of the main
directory:
Within main
directory you should find corrections.json
file and state.mtx
files.
Within main
directory you should find corrections.json
file and state.mtx
files.
Unfortunately contents of corrections.json
and state.mtx
files are too
large to be included in this tutorial.
Now depending on you needs you can proceed with interpretation of those files with use of different software or use CSSFinder to generate report for you.
Report generation¶
Continuation to Example #1
This section will be natural continuation to Example #1
section and will
assume that reader have successfully followed instructions from there.
CSSFinder provides a way to generate summary reports showing results of tasks which were run. Those reports can be generated in HTML, PDF and JSON formats. HTML and PDF are primarily intended for human consumption, while JSON is more suitable for machine processing.
To generate report in PDF format and automatically open it, use following command:
After running this command, you should see report in your default PDF viewer.
To generate report in HTML format and automatically open it, use following command:
PDF reports on Windows
Getting PDF reports to work on Windows can be troublesome. Please check out Installation Guide Windows installation for more information.
After running this command, you should see report in your default HTML viewer.
Example report looks like this: