Tomographer  v5.2
Tomographer C++ Framework Documentation
Tomorun optimized custom build configuration

You may compile a custom version of tomorun, which will better suit your needs and be better adapted your specific computer architecture compared to the generic binary releases of Tomographer/Tomorun.

Proceed as described here. When you arrive at the step where you run cmake, make sure you specify the options which are relevant to you using the -DTOMORUN_CXX_FLAGS=... option.

For instance, if you will only run tomorun on two-qubit systems:

build> cmake .. -DTOMORUN_CXX_FLAGS="-DTOMORUN_CUSTOM_FIXED_DIM=4 -DTOMORUN_CUSTOM_FIXED_MAX_DIM=4 -DTOMORUN_CUSTOM_MAX_POVM_EFFECTS=Eigen::Dynamic"

Or, for instance, if you're sure you will not need very verbose log messages (LONGDEBUG messages will be unconditionally discarded, with a slight runtime speed-up):

build> cmake .. -DTOMORUN_CXX_FLAGS="-DTOMORUN_MAX_LOG_LEVEL=DEBUG"

Or, for instance, if you would like to compile tomorun using types with less precision, in order to gain speed (at the loss of precision though!)

build> cmake .. -DTOMORUN_CXX_FLAGS="-DTOMORUN_INT=int -DTOMORUN_REAL=float"

The possible compile-time options you can set are documented here:

  • TOMORUN_INT

    Value: a integer type

    The main integer type. Used to count a number of iterations, the sweep size, etc.

  • TOMORUN_REAL

    Value: a floating-point type (e.g., float, double, long double)

    The main floating-point type. Used for everything, from the matrix elements of the quantum state to the step size of the random walk. You may try to go to long double if you have trouble with precision — but beware, I haven't tested this and there might still be some hard-coded values at some places (1e-8 epsilons etc.). Beware and please report issues to me!

    Note
    Using float here apparently significantly reduces the precision of the resulting histogram. Make sure you know what you are doing.
  • TOMORUN_CUSTOM_FIXED_DIM, TOMORUN_CUSTOM_FIXED_MAX_DIM, TOMORUN_CUSTOM_MAX_POVM_EFFECTS

    You may define these to fixed values to specialize the tomorun problem to a specific fixed dimension and a specific maximum number of POVM effects. You may set to Eigen::Dynamic to always use dynamic size matrices which may allow any size at run-time. Leave these symbols undefined to have a selection of common values of fixed-size matrices with a fallback to dynamic-size.

    Warning
    You need to define all three macros, not just one or two of them.

    TOMORUN_CUSTOM_FIXED_DIM fixes the dimension of the system to a compile-time fixed value which cannot be changed at run-time. Use Eigen::Dynamic if you want tomorun to work with different system sizes. TOMORUN_CUSTOM_FIXED_MAX_DIM specifies a maximum dimension for the dimension of the quantum system; the latter may at run-time take any value up to this limit; use Eigen::Dynamic for no limit.

    If these are not defined (the default), then some common cases are provided with a fallback to all-dynamic specified at runtime. (See bottom of tomorun.cxx)

  • TOMORUN_MAX_LOG_LEVEL

    Value: one of LONGDEBUG, DEBUG, INFO, WARNING, ERROR.

    If defined, will compile out all log messages of level strictly less severe than the level provided here.

  • TOMORUN_RNG_CLASS

    Value: C++ pseudo random number generator name (e.g. std::mt19937)

    The random number generator algorithm to use for the random walk, given as a C++ class name (see C++11's <random>).

  • TOMORUN_USE_DEVICE_SEED

    Set to a nonzero value to seed the pseudo-random number generators with a seed taken from a physical random device (see also TOMORUN_RANDOM_DEVICE).

    Set to zero to not attempt to access any random device (the code won't even refer to std::random_device). The pseudo-rng's will be seeded using consecutive seeds starting from a base seed derived from the current time.

  • TOMORUN_RANDOM_DEVICE

    The name of the physical random device (see C++ std::random_device constructor) to use to seed the pseudo-RNG.

    This setting doesn't have any effect unless TOMORUN_USE_DEVICE_SEED is set.

    You may leave an empty macro definition to use the default constructor and use the default device.

Less important options which probably shouldn't be specified:

  • TOMORUN_DO_SLOW_POVM_CONSISTENCY_CHECKS

    Value: true | false

    If defined, will make sure that all POVM effects read from the input file are positive semidefinite and nonzero. This doesn't affect the random walk at all, it's only a constant overhead at start-up.

    This option is on by default.

  • TOMORUN_TIMERCLOCK

    Value: C++ clock class name (std::chrono::...) [default: std::chrono::high_resolution_clock ]

    C++ clock type to use when timing the duration of the computation. This option is really historical and was meant to allow compilation with older compilers such as G++ 4.6 which didn't yet support the new C++ clock types.