Document of the "CC2" folder

This page is the document of a new command "new_bfss" in the "CC2" folder. If you want previous commands in the "CC" folder, please read this old document.

Table of contents


Compile

To compile, you can use "make" command in the "CC2" folder as follows.

% make

Before compiling this code, You need to install (FORTRAN-base) BLAS and LAPACK libraries: For example, intel MKL, ACML, or various free implementations. After that, you need to setup CCLIBS in Makefile to link them correctly.

Usage

COMMAND [Options] [Data file] [Parameters]
  [Option]
    -c                : estimate confidential intervals of parameters by MC (default: off)
    -e MAP::EPSILON   : set an epsilon for FR-CG algorithm (default: 1e-8)
    -f SCALING::FORM  : set a scaling form [0:standard, 1:with correction] (default: 0)
    -h                : help
    -i MC::SEED       : set a seed of random number (default::20140318)
    -l MC::LIMIT      : set the limit to the number of MC samples (default: 20000)
    -m MC::NMCS       : set the number of MC samples (default: 1000)
    -n DATA::N        : set the number of data sets (default: 1)
    -s MAP::STEP_SIZE : set a step size of FR-CG algorithm (default: 1e-4)
    -t MAP::TOL       : set a tolerance of FR-CG algorithm (default: 1e-3)
    -w OUTPUT::XSCALE : set a xscale of outputted scaling function (default: 1)
  [Data file]
    If data_file = '-', data are loaded from STDIN
  [Parameters]
    parameter         := mask [0:fixed, 1:unfixed] + initial_value (default of mask: 1, default of initial_value: automatically initialized)
Note
If you want good inference results, we recommend the option "-c" which use a sophisticated Monte Carlo estimation. But the computational cost of Monte Carlo estimation is high, because this code carefully adjusts the sampling condition in the early stage.
Note
You can reduce the length of [Parameters] list. If you don't set a value of a parameter, it is automatically initialized. But, it is better to start from good initial values to succeed in the inferences of critical exponents, because we need to solve a non-linear optimization problem in the first stage.

Test

% make test
./new_bfss Sample/Ising-square-Binder.dat 1 0.42 1 0.9 1 0.1 > test.op 2>test.log
./new_bfss -c Sample/Ising-square-Binder.dat 1 0.42 1 0.9 1 0.1 > test_mc.op 2>test_mc.log

The examples of code's output are in the "Sample" folder.

Format of input data file

For a single observable (DATA::N == 1)

The format of data file is as follows.

# L   T            A              Error_of_A
128   4.200000e-01 6.271240e-02   1.336090e-03

A line has to be ended with the newline character. Comment lines starts with the character '#'. A null line is ignored. There are four values in each line. The value of \( L \) is in the 1st column of data file. The value of \( T \) is in the 2nd column. The value of \( A \) is in the 3rd column. The value of \( \delta A \) is in the 4th column. If a line is not correctly formatted, it will be skipped.

For multiple observables simultaneously (DATA::N > 1)

In this case, we will assume an independent scaling function for each observable with different critical exponents. But the values of \(T_c\) and \(c_1\) and \(c_3\) are shared. We will infer values to succeed in all scaling analyses simultaneously. The format of data file is as follows.

# ID  L   T            A              Error_of_A
0   128   4.200000e-01 6.271240e-02   1.336090e-03

A line has to be ended with the newline character. Comment lines starts with the character '#'. A null line is ignored. There are five values in each line. The value of ID is in the 1st column of data file. It is the identification number of data set. It starts from 0. The maximum number is (DATA::N - 1). The value of \( L \) is in the 2nd column. The value of \( T \) is in the 3rd column. The value of \( A \) is in the 4th column. The value of \( \delta A \) is in the 5th column. If a line is not correctly formatted, it will be skipped.

Scaling form and parameters

For a standard scaling form

The finite-size scaling form is written as

\begin{equation} A(T, L) = L^{c_2} F[ ( T - T_c ) L^{c_1} ], \end{equation}

where \( A \) is an observable. The triplet of a point is defined as

\begin{eqnarray} &&X = (T - T_c ) (L/L_{MAX})^{c_1} / R_X, Y = (A / (L/L_{MAX})^{c_2} - Y_0)/R_Y,\nonumber\\ &&E = \delta A/ (L/L_{MAX})^{c_2}/R_Y, \end{eqnarray}

where \( \delta A \) is an error of \( A \) and \( L_{MAX} \) is the largest \( L \). Scaling factor \( R_X \) is defined so that the width of X for \( L_{MAX} \) is 2. Scaling factor \( R_Y \) and \( Y_0 \) is defined so that Y for \( L_{MAX} \) is in [-1:1]. The data ansatz is

\begin{equation} Y \sim F(X) \pm E. \end{equation}

Kernel function is written as

\begin{equation} k_G(i, j) = \delta_{ij} (E(i)^2 + \theta_0^2) + \theta_1^2 \exp( - |X(i)- X(j)|^2 / 2\theta_2^2 ). \end{equation}

Parameters are defined as Params[0] = \( T_c \), Params[1] = \( c_1 \), Params[2] = \( c_2 \), Params[3] = \( \theta_0 \), Params[4] = \( \theta_1 \), and Params[5] = \( \theta_2 \). Shared parameters are \( T_c \) and \( c_1 \).

For a scaling form with corrections to scaling

The finite-size scaling form is written as

\begin{equation} A(T, L) = L^{c_2} F[ ( T - T_c ) L^{c_1}, L^{-c_3} ], \end{equation}

where \( A \) is an observable. The triplet of a point is defined as

\begin{eqnarray} &&X_1 = (T - T_c ) (L/L_{MAX})^{c_1} / R_X, X_2 = (L/L_{MIN})^{-c_3},\nonumber\\ &&Y = (A / (L/L_{MAX})^{c_2} - Y_0)/R_Y, E = \delta A/ (L/L_{MAX})^{c_2}/R_Y, \end{eqnarray}

where \( \delta A \) is an error of \( A \) and \( L_{MAX} \) is the largest \( L \). Scaling factor \( R_X \) is defined so that the width of X for \( L_{MAX} \) is 2. Scaling factor \( R_Y \) and \( Y_0 \) is defined so that Y for \( L_{MAX}\) is in [-1:1]. The data ansatz is

\begin{equation} Y \sim F(X_1, X_2) \pm E. \end{equation}

Kernel function is written as

\begin{eqnarray} k_G(i, j) = \delta_{ij} (E(i)^2 + \theta_0^2) + \theta_1^2 \exp\left[ - \frac{|X_1(i)- X_1(j)|^2}{2\theta_2^2}\right]\nonumber\\ + \theta_3^2 \exp\left[ - \frac{|X_1(i)- X_1(j)|^2}{2\theta_4^2}\right] X_2(i) X_2(j). \end{eqnarray}

Parameters are defined as Params[0] = \( T_c \), Params[1] = \( c_1 \), Params[2] = \( c_3 \), Params[3] = \( c_2 \), Params[4] = \( \theta_0 \), Params[5] = \( \theta_1 \), Params[6] = \( \theta_2 \), Params[7] = \( \theta_3 \), and Params[8] = \( \theta_4 \). Shared parameters are \( T_c, c_1 \) and \( c_3 \).

Note
In the case of multiple observables, the first part of a parameter list is for shared parameters. The non-shared parameters are put after the shared parameters. For example, \( (T_c, c_1, c_3, c_2, \theta_0, \theta_1, \theta_2, \theta_3, \theta_4, c_2', \theta_0', \theta_1', \theta_2', \theta_3', \theta_4')\).

Output

The process of the optimization and sampling of parameters is reported to a standard err channel. The inference results of parameters is reported to a standard output channel.

Header comment

The value of inferred parameters and the confidential intervals are written in header comments as follows.

# p[0] = 4.4068289283487466e-01 6.5315475997187452e-06 --> Average and standard deviation
...
# cov[0, 0]=4.2661114047391705e-11 --> Value of covariance matrix's element
...
# local p[0] = 4.4068289283487466e-01 --> Value of parameter for scaling data
...

Results

The remain part consists of some outputs for each data set. A output for a data set consists of four groups as follows:

  • Scaling results
  • Scaling function
  • Scaling results by normalized variables
  • Scaling function by normalized variables

These output groups are separated two null lines.

The line of the first group "Scaling results" contains as \( [ (T - T_c ) L^{c_1}, A / L^{c_2}, \delta A/L^{c_2},L, T, A, \delta A ] \) for a standard scaling form, and as \( [ (T - T_c ) L^{c_1}, A / L^{c_2}, \delta A/L^{c_2}, L^{-c_3}, L, T, A, \delta A ] \) for the case of corrections to scaling.

The second group for "Scaling function" consists of 100 points of the inferred scaling function in the thermodynamic limit. The output range of x axis is equal to the range of the largest system size. It can be changed the option "-w". Three values, \( [X, \mu(X), \sqrt{\sigma^2(X)} ]\) are outputed in each line. \(\mu(X)\) is an inference result for scaling function \( F[X] \). \( \sqrt{\sigma^2(X)} \) is a confidential intervale of the inference result.

The third and the fourth groups use a normalized variables.