updated libquantum 0.2.4 source files

This commit is contained in:
libquantum
2016-10-27 04:20:46 +09:00
parent 42c207188a
commit e742b26967
9 changed files with 91 additions and 48 deletions

View File

@@ -1,3 +1,7 @@
libquantum 0.2.4:
- Fixed a bug in the wrapper for the density operator formalism
that caused a compiler error when using some gates
libquantum 0.2.3:
- Added density operator formalism
- Added functions for dot product and purity

View File

@@ -1,6 +1,6 @@
# Makefile: Build libquantum
#
# Copyright 2003, 2004 Bjoern Butscher, Hendrik Weimer
# Copyright 2003-2005 Bjoern Butscher, Hendrik Weimer
#
# This file is part of libquantum
#
@@ -49,15 +49,12 @@ LIBTOOL=@LIBTOOL@
# Flags passed to C compiler
CFLAGS=@CFLAGS@
LDFLAGS=-rpath $(LIBDIR) -version-info 5:0:2
LDFLAGS=-rpath $(LIBDIR) -version-info 5:1:2
# Dependencies
all: libquantum.la
Makefile: Makefile.in configure.in config.h.in types.h.in quantum.h.in
./configure
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 Makefile
@@ -66,7 +63,7 @@ libquantum.la: complex.lo measure.lo matrix.lo gates.lo qft.lo classic.lo\
classic.lo qureg.lo decoherence.lo qec.lo version.lo objcode.lo\
density.lo -lm
complex.lo: complex.c complex.h Makefile
complex.lo: complex.c complex.h config.h Makefile
$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c complex.c
measure.lo: measure.c measure.h matrix.h qureg.h complex.h config.h Makefile
@@ -113,6 +110,17 @@ objcode.lo: objcode.c objcode.h matrix.h gates.h qureg.h measure.h config.h\
density.lo: density.c density.h matrix.h qureg.h complex.h config.h Makefile
$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c density.c
# Autoconf stuff
Makefile: configure Makefile.in aclocal.m4 config.h.in types.h.in quantum.h.in
./configure
config.h: config.h.in
./configure
configure: configure.in
autoconf
# Build demos of Shor's and Grover's algorithms
demos: shor grover
@@ -158,6 +166,8 @@ distclean:
-rm shor *.lo *.o config.h quantum.h config.status config.log\
libquantum.la
# Build the source tarball
dist:
-rm quantum.h config.h types.h
mkdir libquantum-$(VERSION)

2
aclocal.m4 vendored
View File

@@ -23,7 +23,7 @@
## the same distribution terms that you use for the rest of that program.
# serial 47 AC_PROG_LIBTOOL
# Debian $Rev: 214 $
# Debian $Rev: 133 $
# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)

View File

@@ -1,4 +1,25 @@
/* config.h.in. Generated from configure.in by autoheader. */
/* config.h: configure settings
Copyright 2003-2005 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 2 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA
*/
/* Complex data type */
#undef COMPLEX_FLOAT
@@ -67,4 +88,7 @@
if it is not supported. */
#undef inline
/* Define to 1 if you have GCC */
#undef HAVE_GCC
#include "types.h"

22
configure vendored
View File

@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.59 for libquantum 0.2.3.
# Generated by GNU Autoconf 2.59 for libquantum 0.2.4.
#
# Report bugs to <libquantum@enyo.de>.
#
@@ -419,8 +419,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='libquantum'
PACKAGE_TARNAME='libquantum'
PACKAGE_VERSION='0.2.3'
PACKAGE_STRING='libquantum 0.2.3'
PACKAGE_VERSION='0.2.4'
PACKAGE_STRING='libquantum 0.2.4'
PACKAGE_BUGREPORT='libquantum@enyo.de'
ac_unique_file="classic.c"
@@ -930,7 +930,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures libquantum 0.2.3 to adapt to many kinds of systems.
\`configure' configures libquantum 0.2.4 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -991,7 +991,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of libquantum 0.2.3:";;
short | recursive ) echo "Configuration of libquantum 0.2.4:";;
esac
cat <<\_ACEOF
@@ -1127,7 +1127,7 @@ fi
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
libquantum configure 0.2.3
libquantum configure 0.2.4
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
@@ -1141,7 +1141,7 @@ cat >&5 <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by libquantum $as_me 0.2.3, which was
It was created by libquantum $as_me 0.2.4, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
@@ -9122,6 +9122,10 @@ fi;
# Enable -Wall for gcc
if test $CC = "gcc"
then
cat >>confdefs.h <<\_ACEOF
#define HAVE_GCC 1
_ACEOF
CFLAGS="$CFLAGS -Wall"
fi
@@ -9490,7 +9494,7 @@ _ASBOX
} >&5
cat >&5 <<_CSEOF
This file was extended by libquantum $as_me 0.2.3, which was
This file was extended by libquantum $as_me 0.2.4, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -9550,7 +9554,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
libquantum config.status 0.2.3
libquantum config.status 0.2.4
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"

View File

@@ -1,5 +1,26 @@
# Process this file with autoconf to produce a configure script.
AC_INIT([libquantum], [0.2.3], [libquantum@enyo.de])
# configure.in: Process this file with autoconf to produce a configure
# script.
#
# Copyright 2003-2005 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 2 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA
AC_INIT([libquantum], [0.2.4], [libquantum@enyo.de])
AC_CONFIG_SRCDIR([classic.c])
AC_CONFIG_HEADER([config.h])
@@ -94,6 +115,7 @@ AC_ARG_ENABLE(profiling,
# Enable -Wall for gcc
if test $CC = "gcc"
then
AC_DEFINE(HAVE_GCC)
CFLAGS="$CFLAGS -Wall"
fi

View File

@@ -1,6 +1,6 @@
/* density.h: Declarations for density.c
Copyright 2004 Bjoern Butscher, Hendrik Weimer
Copyright 2004, 2005 Bjoern Butscher, Hendrik Weimer
This file is part of libquantum
@@ -27,24 +27,14 @@
#include "qureg.h"
#define quantum_density_wrapper_ubt(reg, ctl, ...) \
quantum_unbounded_toffoli(ctl, reg, __VA_ARGS__)
#define quantum_density_operation(function, rho, ...) \
do{ \
int quantum_int; \
if ((void *) function == quantum_unbounded_toffoli) \
{ \
for(quantum_int=0; quantum_int < rho.num; quantum_int++) \
quantum_density_wrapper_ubt(&rho.reg[quantum_int], __VA_ARGS__); \
} \
else \
{ \
for(quantum_int=0; quantum_int < rho.num; quantum_int++) \
function(__VA_ARGS__, &rho.reg[quantum_int]); \
} \
} while(0)
struct quantum_density_op_struct
{
int num; /* total number of state vectors */

View File

@@ -44,7 +44,7 @@ EXIT_FAILURE=1
PROGRAM=ltmain.sh
PACKAGE=libtool
VERSION=1.5.6
TIMESTAMP=" (1.1220.2.95 2004/04/11 05:50:42) Debian$Rev: 220 $"
TIMESTAMP=" (1.1220.2.95 2004/04/11 05:50:42) Debian$Rev: 133 $"
# Check that we have a working $echo.

View File

@@ -1,6 +1,6 @@
/* quantum.h: Header file for libquantum
Copyright 2003, 2004 Bjoern Butscher, Hendrik Weimer
Copyright 2003-2005 Bjoern Butscher, Hendrik Weimer
This file is part of libquantum
@@ -28,22 +28,11 @@
#define COMPLEX_FLOAT @CF_TYPE@
#define MAX_UNSIGNED @MU_TYPE@
#define quantum_density_wrapper_ubt(reg, ctl, ...) \
quantum_unbounded_toffoli(ctl, reg, __VA_ARGS__)
#define quantum_density_operation(function, rho, ...) \
do{ \
int quantum_int; \
if ((void *) function == quantum_unbounded_toffoli) \
{ \
for(quantum_int=0; quantum_int < rho.num; quantum_int++) \
quantum_density_wrapper_ubt(&rho.reg[quantum_int], __VA_ARGS__); \
} \
else \
{ \
for(quantum_int=0; quantum_int < rho.num; quantum_int++) \
function(__VA_ARGS__, &rho.reg[quantum_int]); \
} \
} while(0)
/* A ROWS x COLS matrix with complex elements */