- Clone this repository to a directory:
git clone https://github.com/cscjlan/qcqubo.git cd qcqubo- Create a directory for binaries:
mkdir bin - Run
scripts/build.shon e.g a login node. This builds an executablequboin thebin/directory.
First, use the data/inputs.json to specify the inputs to the program.
Specifically:
seed: what random seed to usenum_to_search: how many random binary vectors to generate and testmatrix_filename: the.csvfile containing the matrix, either in csr format or in "dense" format, i.e. containing all the elements, including the zero elementsoutput_filename: where to output the best binary vector
After you're satisfied with the inputs, use sbatch -A project_YOUR_PROJECT_NUMBER scripts/lumi_run.sh
to queue the program, where YOUR_PROJECT_NUMBER is a number of the project you want the billing of the used
resources to go to.
The matrix can be given as a dense .csv file, in which case the zeroes should be included.
If it's given as a csr matrix, the .csv file should contain three rows (for a N x N matrix):
indptrindicesdata.
See the SciPy csr matrix for the meaning of the names.
Given a SciPy csr matrix csr_mat, the following Python snippet writes the matrix in the correct format for this program:
with open(f"data/csr_matrix.csv", "w") as f:
csr_mat.indptr.tofile(f, sep=",")
f.write("\n")
csr_mat.indices.tofile(f, sep=",")
f.write("\n")
csr_mat.data.tofile(f, sep=",")