Commit 336c8c82 authored by Boris Pek's avatar Boris Pek

Imported Upstream version 1.1.1

parent 3d486f48
libquantum 1.1.1:
- Added support for ground state calculations
- Added example program simulating the tranverse Ising chain
- Optimized memory layout for quantum registers (thanks to
Acumem, breaks backward compatiblity)
- Added OpenMP support
- Improved C99 compatibility for complex numbers
- Improved support of double precision arithmetic
libquantum 1.1.0:
- Added exact diagonlization based on LAPACK
- Added flag in quantum_rk4 to preserve qureg (breaks backward
......
......@@ -48,8 +48,8 @@ LIBTOOL=@LIBTOOL@
# Flags passed to C compiler
CFLAGS=@CFLAGS@
LDFLAGS=-rpath $(LIBDIR) -version-info 7:0:0
CFLAGS=@CFLAGS@ @OPENMP_CFLAGS@
LDFLAGS=-rpath $(LIBDIR) -version-info 8:0:0
# Dependencies
......@@ -57,11 +57,11 @@ all: libquantum.la
libquantum.la: complex.lo measure.lo matrix.lo gates.lo qft.lo classic.lo \
qureg.lo decoherence.lo oaddn.lo omuln.lo expn.lo qec.lo version.lo \
objcode.lo density.lo error.lo qtime.lo lapack.lo Makefile
objcode.lo density.lo error.lo qtime.lo lapack.lo energy.lo Makefile
$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o libquantum.la complex.lo \
measure.lo matrix.lo gates.lo oaddn.lo omuln.lo expn.lo qft.lo \
classic.lo qureg.lo decoherence.lo qec.lo version.lo objcode.lo \
density.lo error.lo qtime.lo lapack.lo @LIBS@
density.lo error.lo qtime.lo lapack.lo energy.lo @LIBS@
complex.lo: complex.c complex.h config.h Makefile
$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c complex.c
......@@ -123,6 +123,9 @@ qtime.lo: qtime.c qtime.h qureg.h Makefile
lapack.lo: lapack.c lapack.h matrix.h qureg.h config.h error.h Makefile
$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c lapack.c
energy.lo: energy.c energy.h qureg.h config.h error.h Makefile
$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c energy.c
# Autoconf stuff
Makefile: config.status Makefile.in aclocal.m4 config.h.in types.h.in \
......@@ -140,7 +143,7 @@ config.status: configure
# Build demos of Shor's and Grover's algorithms
demos: shor grover
demos: shor grover ising
shor: libquantum.la shor.c Makefile
$(LIBTOOL) --mode=link $(CC) $(CFLAGS) -o shor shor.c -I./ -lquantum \
......@@ -150,6 +153,10 @@ grover: libquantum.la grover.c Makefile
$(LIBTOOL) --mode=link $(CC) $(CFLAGS) -o grover grover.c -I./ \
-lquantum -static -lm
ising: libquantum.la ising.c Makefile
$(LIBTOOL) --mode=link $(CC) $(CFLAGS) -o ising ising.c -I./ -lquantum \
-static -lm
# Quantum object code tools
quobtools: quobprint quobdump
......
......@@ -22,26 +22,27 @@
*/
#include <math.h>
#include <complex.h>
#include "complex.h"
#include "config.h"
/* Return the complex conjugate of a complex number */
COMPLEX_FLOAT
/*COMPLEX_FLOAT
quantum_conj(COMPLEX_FLOAT a)
{
float r, i;
REAL_FLOAT r, i;
r = quantum_real(a);
i = quantum_imag(a);
return r - IMAGINARY * i;
}
}*/
/* Calculate the square of a complex number (i.e. the probability) */
float
double
quantum_prob(COMPLEX_FLOAT a)
{
return quantum_prob_inline(a);
......@@ -49,7 +50,7 @@ quantum_prob(COMPLEX_FLOAT a)
/* Calculate e^(i * phi) */
COMPLEX_FLOAT quantum_cexp(float phi)
COMPLEX_FLOAT quantum_cexp(REAL_FLOAT phi)
{
return cos(phi) + IMAGINARY * sin(phi);
}
......@@ -25,37 +25,22 @@
#define __COMPLEX_H
#include <complex.h>
#include "config.h"
extern COMPLEX_FLOAT quantum_conj(COMPLEX_FLOAT a);
#define quantum_conj(z) (conj(z))
#define quantum_real(z) (creal(z))
#define quantum_imag(z) (cimag(z))
extern float quantum_prob (COMPLEX_FLOAT a);
extern COMPLEX_FLOAT quantum_cexp(float phi);
/* Return the real part of a complex number */
static inline float
quantum_real(COMPLEX_FLOAT a)
{
float *p = (float *) &a;
return p[0];
}
/* Return the imaginary part of a complex number */
static inline float
quantum_imag(COMPLEX_FLOAT a)
{
float *p = (float *) &a;
return p[1];
}
extern double quantum_prob (COMPLEX_FLOAT a);
extern COMPLEX_FLOAT quantum_cexp(REAL_FLOAT phi);
/* Calculate the square of a complex number (i.e. the probability) */
static inline float
static inline double
quantum_prob_inline(COMPLEX_FLOAT a)
{
float r, i;
REAL_FLOAT r, i;
r = quantum_real(a);
i = quantum_imag(a);
......
......@@ -94,4 +94,7 @@
/* Define to 1 if you have LAPACK */
#undef HAVE_LIBLAPACK
/* Define to 1 if using double precision */
#undef USE_DOUBLE
#include "types.h"
This diff is collapsed.
# configure.in: Process this file with autoconf to produce a configure
# script.
#
# Copyright 2003-2005 Bjoern Butscher, Hendrik Weimer
# Copyright 2003-2013 Bjoern Butscher, Hendrik Weimer
#
# This file is part of libquantum
#
......@@ -20,7 +20,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA
AC_INIT([libquantum], [1.1.0], [libquantum@libquantum.de])
AC_INIT([libquantum], [1.1.1], [libquantum@libquantum.de])
AC_CONFIG_SRCDIR([classic.c])
AC_CONFIG_HEADER([config.h])
......@@ -35,7 +35,7 @@ AC_PROG_LIBTOOL
# Checks for libraries.
AC_CHECK_LIB([m], [sqrt])
AC_ARG_WITH(lapack,
[ --with-lapack LAPACK support [default=yes]],
[ --with-lapack LAPACK support [[default=yes]]],
[if test $withval = "yes"
then
AC_CHECK_LIB([lapack], [cheev_])
......@@ -75,11 +75,16 @@ fi
# Check for complex number type
AC_ARG_WITH([complex-type],
[ --with-complex-type=ARG type for complex numbers],
[CF_TYPE=$withval
], [CF_TYPE="none"
AC_CHECK_TYPE([float _Complex], [AC_DEFINE([COMPLEX_FLOAT],
[float _Complex])
CF_TYPE="float _Complex"])])
[CF_TYPE=$withval], [CF_TYPE="none"
AC_CHECK_TYPE([float complex], [AC_DEFINE([COMPLEX_FLOAT],
[float complex])
CF_TYPE="float complex"])])
if test "$CF_TYPE" = "none"
then
AC_CHECK_TYPE([float _Complex], [AC_DEFINE([COMPLEX_FLOAT],
[float _Complex])
CF_TYPE="float _Complex"])
fi
if test "$CF_TYPE" = "none"
then
AC_CHECK_TYPE([__complex__ float], [AC_DEFINE([COMPLEX_FLOAT],
......@@ -91,6 +96,14 @@ then
AC_MSG_ERROR([No complex number type!])
fi
AC_MSG_CHECKING([for corresponding real data type])
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([], [return sizeof($CF_TYPE) == 2*sizeof(double)])],
[RF_TYPE="float"],
[RF_TYPE="double"; AC_DEFINE(USE_DOUBLE)], [float])
AC_MSG_RESULT($RF_TYPE)
# Check for the imaginary unit
AC_MSG_CHECKING([for the imaginary unit])
AC_ARG_WITH([imaginary],
......@@ -108,9 +121,13 @@ then
fi
AC_MSG_RESULT($I)
# Check for OpenMP support
AC_OPENMP
# Substitute fields in quantum.h.in and types.h
AC_SUBST(MU_TYPE)
AC_SUBST(CF_TYPE)
AC_SUBST(RF_TYPE)
AC_SUBST(I)
# Profiling check
......@@ -120,9 +137,6 @@ AC_ARG_ENABLE(profiling,
then CFLAGS="$CFLAGS -pg -fprofile-arcs -ftest-coverage"
fi], [])
# Disable LAPACK check
# Enable -Wall for gcc
if test $CC = "gcc"
then
......
......@@ -114,13 +114,13 @@ quantum_decohere(quantum_reg *reg)
for(j=0; j<reg->width; j++)
{
if(reg->node[i].state & ((MAX_UNSIGNED) 1 << j))
if(reg->state[i] & ((MAX_UNSIGNED) 1 << j))
angle += nrands[j];
else
angle -= nrands[j];
}
reg->node[i].amplitude *= quantum_cexp(angle);
reg->amplitude[i] *= quantum_cexp(angle);
}
free(nrands);
......
......@@ -66,7 +66,8 @@ quantum_new_density_op(int num, float *prob, quantum_reg *reg)
reg[0].size = 0;
reg[0].width = 0;
reg[0].node = 0;
reg[0].state = 0;
reg[0].amplitude = 0;
reg[0].hash = 0;
for(i=1; i<num; i++)
......@@ -78,7 +79,8 @@ quantum_new_density_op(int num, float *prob, quantum_reg *reg)
reg[i].size = 0;
reg[i].width = 0;
reg[i].node = 0;
reg[i].state = 0;
reg[i].amplitude = 0;
reg[i].hash = 0;
}
......@@ -133,8 +135,8 @@ quantum_reduced_density_op(int pos, quantum_density_op *rho)
for(j=0; j<rho->reg[i].size; j++)
{
if(!(rho->reg[i].node[j].state & pos2))
p0 += quantum_prob_inline(rho->reg[i].node[j].amplitude);
if(!(rho->reg[i].state[j] & pos2))
p0 += quantum_prob_inline(rho->reg[i].amplitude[j]);
}
rho->prob[i] = ptmp * p0;
......@@ -176,8 +178,8 @@ quantum_density_matrix(quantum_density_op *rho)
l1 = quantum_get_state(i, rho->reg[k]);
l2 = quantum_get_state(j, rho->reg[k]);
if((l1 > -1) && (l2 > -1))
M(m, i, j) += rho->prob[k] * rho->reg[k].node[l2].amplitude
* quantum_conj(rho->reg[k].node[l1].amplitude);
M(m, i, j) += rho->prob[k] * rho->reg[k].amplitude[l2]
* quantum_conj(rho->reg[k].amplitude[l1]);
}
}
}
......@@ -246,14 +248,14 @@ quantum_purity(quantum_density_op *rho)
/* quantum_dot_product makes sure that rho->reg[j] has a
correct hash table */
l = quantum_get_state(rho->reg[i].node[k].state, rho->reg[j]);
l = quantum_get_state(rho->reg[i].state[k], rho->reg[j]);
/* Compute p_i p_j <k|\psi_iX\psi_i|\psi_jX\psi_j|k> */
if(l > -1)
g = rho->prob[i] * rho->prob[j] * dp
* rho->reg[i].node[k].amplitude
* quantum_conj(rho->reg[j].node[l].amplitude);
* rho->reg[i].amplitude[k]
* quantum_conj(rho->reg[j].amplitude[l]);
else
g = 0;
......
/* energy.c: Compute energetic properties of quantum systems
Copyright 2013 Hendrik Weimer
This file is part of libquantum
libquantum is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 3 of the License,
or (at your option) any later version.
libquantum is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with libquantum; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA
*/
#include <float.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "energy.h"
#include "qureg.h"
#include "qtime.h"
#include "complex.h"
extern void dstevd_(char *jobz, int *n, double *d, double *e, double *z,
int *ldz, double *work, int *lwork, int *iwork, int *liwork,
int *info);
/* Modified Lanczos algorithm that iterates over a series of 2x2
matrix diagonalzations [E. Dagotto & A. Moreo, Phys. Rev. D 31, 865
(1985)] */
double
quantum_lanczos_modified(quantum_reg H(MAX_UNSIGNED, double), double epsilon,
quantum_reg *reg)
{
double E0=DBL_MAX, Eold=DBL_MAX, E1, E2, t;
quantum_reg tmp, tmp2;
int i;
COMPLEX_FLOAT h01;
double h00, h11;
for(i=0; i<reg->size; i++)
{
quantum_normalize(reg);
tmp = quantum_matrix_qureg(H, 0, reg, QUANTUM_RK4_NODELETE);
h00 = quantum_real(quantum_dot_product(&tmp, reg));
E0 = h00;
if(fabs(E0-Eold)<epsilon)
return E0;
Eold = E0;
quantum_copy_qureg(reg, &tmp2);
quantum_scalar_qureg(-h00, &tmp2);
quantum_vectoradd_inplace(&tmp, &tmp2);
quantum_normalize(&tmp);
quantum_delete_qureg(&tmp2);
tmp2 = quantum_matrix_qureg(H, 0, &tmp, QUANTUM_RK4_NODELETE);
h11 = quantum_real(quantum_dot_product(&tmp2, &tmp));
h01 = quantum_dot_product(&tmp2, reg);
t = sqrt(h11*h11-2*h00*h11+4*h01*quantum_conj(h01)+h00*h00);
E1 = -(t-h11-h00)/2.;
E2 = (t+h11+h00)/2.;
if(E1<E2)
{
quantum_scalar_qureg(-(t-h11+h00)/2./h01, &tmp);
quantum_vectoradd_inplace(reg, &tmp);
}
else
{
quantum_scalar_qureg((t+h11-h00)/2./h01, &tmp);
quantum_vectoradd_inplace(reg, &tmp);
}
quantum_delete_qureg(&tmp);
quantum_delete_qureg(&tmp2);
}
quantum_error(QUANTUM_ENOCONVERGE);
return nan("0");
}
/* Standard Lanczos algorithm without reorthogonalization (see, e.g.,
[E. Dagotto, Rev. Mod. Phys. 66, 763 (1994)]. */
double
quantum_lanczos(quantum_reg H(MAX_UNSIGNED, double), double epsilon,
quantum_reg *reg)
{
#ifdef HAVE_LIBLAPACK
double E0=DBL_MAX, Eold=DBL_MAX, *a, *b, *d, *e, norm, *eig, *work;
quantum_reg *phi, tmp;
int n, i, j;
char jobz = 'V';
int lwork, *iwork, liwork, info;
phi = calloc(2, sizeof(quantum_reg));
a = calloc(2, sizeof(double));
b = calloc(2, sizeof(double));
work = malloc(sizeof(double));
iwork = malloc(sizeof(int));
eig = malloc(sizeof(double));
d = malloc(sizeof(double));
e = malloc(sizeof(double));
if(!(phi && a && b && work && iwork && eig && d && e))
quantum_error(QUANTUM_ENOMEM);
quantum_memman(2*sizeof(quantum_reg)+4*sizeof(double));
quantum_copy_qureg(reg, &phi[0]);
quantum_normalize(&phi[0]);
tmp = quantum_matrix_qureg(H, 0, &phi[0], QUANTUM_RK4_NODELETE);
a[0] = quantum_dot_product(&tmp, &phi[0]);
quantum_copy_qureg(&phi[0], &phi[1]);
quantum_scalar_qureg(-a[0], &phi[1]);
quantum_vectoradd_inplace(&phi[1], &tmp);
quantum_delete_qureg(&tmp);
tmp = quantum_matrix_qureg(H, 0, &phi[1], QUANTUM_RK4_NODELETE);
norm = quantum_dot_product(&phi[1], &phi[1]);
a[1] = quantum_dot_product(&tmp, &phi[1]) / norm;
b[0] = norm / quantum_dot_product(&phi[0], &phi[0]);
for(n=2; n<reg->size; n++)
{
lwork = n*n+4*n+1;
work = realloc(work, lwork*sizeof(double));
liwork = 5*n+3;
iwork = realloc(iwork, lwork*sizeof(int));
eig = realloc(eig, n*n*sizeof(double));
d = realloc(d, n*sizeof(double));
e = realloc(e, n*sizeof(double));
if(!(work && iwork && eig && d && e))
quantum_error(QUANTUM_ENOMEM);
memcpy(d, a, n*sizeof(double));
for(i=0; i<n; i++)
e[i] = sqrt(b[i]);
dstevd_(&jobz, &n, d, e, eig, &n, work, &lwork, iwork, &liwork, &info);
if(info < 0)
quantum_error(QUANTUM_ELAPACKARG);
else if(info > 0)
quantum_error(QUANTUM_ELAPACKCONV);
E0 = d[0];
if(fabs(E0-Eold) < epsilon)
break;
Eold = E0;
phi = realloc(phi, (n+1)*sizeof(quantum_reg));
a = realloc(a, (n+1)*sizeof(double));
b = realloc(b, (n+1)*sizeof(double));
if(!(phi && a && b))
quantum_error(QUANTUM_ENOMEM);
quantum_memman(sizeof(quantum_reg)+2*sizeof(double));
quantum_copy_qureg(&phi[n-1], &phi[n]);
quantum_scalar_qureg(-a[n-1], &phi[n]);
quantum_vectoradd_inplace(&phi[n], &tmp);
quantum_delete_qureg(&tmp);
quantum_copy_qureg(&phi[n-2], &tmp);
quantum_scalar_qureg(-b[n-2], &tmp);
quantum_vectoradd_inplace(&phi[n], &tmp);
/* printf("%i %f\n", n, quantum_prob(quantum_dot_product(&phi[n],
&phi[0]))); */
quantum_delete_qureg(&tmp);
tmp = quantum_matrix_qureg(H, 0, &phi[n], QUANTUM_RK4_NODELETE);
norm = quantum_dot_product(&phi[n], &phi[n]);
a[n] = quantum_dot_product(&tmp, &phi[n]) / norm;
b[n-1] = norm / quantum_dot_product(&phi[n-1], &phi[n-1]);
}
if(n == reg->size)
{
quantum_error(QUANTUM_ENOCONVERGE);
return nan("0");
}
for(i=0; i<n; i++)
quantum_normalize(&phi[i]);
for(i=0; i<reg->size; i++)
{
reg->amplitude[i] = 0;
for(j=0; j<n; j++)
reg->amplitude[i] += eig[j]*phi[j].amplitude[i];
}
quantum_delete_qureg(&tmp);
for(i=0; i<n; i++)
quantum_delete_qureg(&phi[i]);
free(phi);
free(a);
free(b);
free(d);
free(e);
free(eig);
free(work);
free(iwork);
return E0;
#else
quantum_error(QUANTUM_ENOLAPACK);
#endif /* HAVE_LIBLAPACK */
}
/* Imaginary time evolution algorithm */
double
quantum_imaginary_time(quantum_reg H(MAX_UNSIGNED, double), double epsilon,
double dt, quantum_reg *reg)
{
double E0=DBL_MAX, Eold=DBL_MAX;
quantum_reg reg2;
int i;
for(i=0; i<reg->size; i++)
{
quantum_rk4(reg, 0, dt, H, QUANTUM_RK4_IMAGINARY | QUANTUM_RK4_NODELETE);
reg2 = quantum_matrix_qureg(H, 0, reg, QUANTUM_RK4_NODELETE);
E0 = quantum_real(quantum_dot_product(&reg2, reg));
quantum_delete_qureg(&reg2);
if(fabs(Eold-E0)<epsilon)
break;
Eold = E0;
}
if(i == reg->size)
{
quantum_error(QUANTUM_ENOCONVERGE);
return nan("0");
}
else
return E0;
}
/* Wrapper around the various solver functions */
double
quantum_groundstate(quantum_reg *reg, double epsilon,
quantum_reg H(MAX_UNSIGNED, double), int solver,
double stepsize)
{
switch(solver)
{
case QUANTUM_SOLVER_LANCZOS:
return quantum_lanczos(H, epsilon, reg);
case QUANTUM_SOLVER_LANCZOS_MODIFIED:
return quantum_lanczos_modified(H, epsilon, reg);
case QUANTUM_SOLVER_IMAGINARY_TIME:
return quantum_imaginary_time(H, epsilon, stepsize, reg);
default:
quantum_error(QUANTUM_ENOSOLVER);
return nan("0");
}
}
/* energy.h: Declarations for energy.c
Copyright 2013 Hendrik Weimer
This file is part of libquantum
libquantum is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 3 of the License,
or (at your option) any later version.
libquantum is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with libquantum; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA
*/
#ifndef __ENERGY_H
#define __ENERGY_H
#include "config.h"
#include "qureg.h"
enum {
QUANTUM_SOLVER_LANCZOS,
QUANTUM_SOLVER_LANCZOS_MODIFIED,
QUANTUM_SOLVER_IMAGINARY_TIME
};
extern double quantum_groundstate(quantum_reg *reg, double epsilon,
quantum_reg H(MAX_UNSIGNED, double),
int solver, double stepsize);
#endif
......@@ -54,12 +54,16 @@ quantum_strerr(int errno)
return "wrong matrix size";
case QUANTUM_EHASHFULL:
return "hash table full";
case QUANTUM_EHERMITIAN:
return "matrix not Hermitian";
case QUANTUM_ENOCONVERGE:
return "method failed to converge";
case QUANTUM_ENOLAPACK:
return "LAPACK support not compiled in";
case QUANTUM_ELAPACKARG:
return "wrong arguments supplied to LAPACK";
case QUANTUM_ELAPACKCHEEV:
return "LAPACK's CHEEV failed to converge";
case QUANTUM_ELAPACKCONV:
return "LAPACK failed to converge";
case QUANTUM_EMCMATRIX:
return "single-column matrix expected";
case QUANTUM_EOPCODE:
......
......@@ -32,9 +32,12 @@ enum {
QUANTUM_EMLARGE = 3,
QUANTUM_EMSIZE = 4,
QUANTUM_EHASHFULL = 5,
QUANTUM_EHERMITIAN = 6,
QUANTUM_ENOCONVERGE = 7,
QUANTUM_ENOSOLVER = 8,
QUANTUM_ENOLAPACK = 32768, /* LAPACK errors start at 32768 */
QUANTUM_ELAPACKARG = 32769,
QUANTUM_ELAPACKCHEEV = 32770,
QUANTUM_ELAPACKCONV = 32770,
QUANTUM_EMCMATRIX = 65536, /* internal errors start at 65536 */
QUANTUM_EOPCODE = 65537
};
......
This diff is collapsed.
......@@ -145,6 +145,7 @@ int main(int argc, char **argv)
width = quantum_getwidth(N+1);
reg = quantum_new_qureg(0, width);
// reg.width--;
quantum_sigma_x(reg.width, &reg);
......@@ -169,9 +170,9 @@ int main(int argc, char **argv)
for(i=0; i<reg.size; i++)
{
if(reg.node[i].state == N)
if(reg.state[i] == N)
printf("\nFound %i with a probability of %f\n\n", N,
quantum_prob(reg.node[i].amplitude));
quantum_prob(reg.amplitude[i]));
}
quantum_delete_qureg(&reg);
......
/* ising.c: Calculate the ground state of the transverse field Ising model
Copyright 2013 Bjoern Butscher, Hendrik Weimer
This file is part of libquantum
libquantum is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 3 of the License,
or (at your option) any later version.
libquantum is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of