10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-11-19 04:22:21 +01:00
QCaml/Notebooks/F12_fast.ipynb

339 KiB

None <html> <head> </head>

Test of F12 matrix elements

Initialization

In [32]:
let png_image = print_endline ;;

(* --------- *)

#cd "/home/scemama/QCaml";;
#use "topfind";;
#require "jupyter.notebook";;

let png_image name = 
    Jupyter_notebook.display_file ~base64:true "image/png" ("Notebooks/images/"^name)
;;

#require "lacaml.top";;
#require "alcotest";;
#require "str";;
#require "bigarray";;
#require "zarith";;
#require "getopt";;
#directory "_build";;
#directory "_build/Basis";;
#directory "_build/CI";;
#directory "_build/MOBasis";;
#directory "_build/Nuclei";;
#directory "_build/Parallel";;
#directory "_build/Perturbation";;
#directory "_build/SCF";;
#directory "_build/Utils";;
Out[32]:
val png_image : string -> unit = <fun>
- : unit = ()
Findlib has been successfully loaded. Additional directives:
  #require "package";;      to load a package
  #list;;                   to list the available packages
  #camlp4o;;                to load camlp4 (standard syntax)
  #camlp4r;;                to load camlp4 (revised syntax)
  #predicates "p,q,...";;   to set these predicates
  Topfind.reset();;         to force that packages will be reloaded
  #thread;;                 to enable threads

- : unit = ()
Out[32]:
val png_image : string -> Jupyter_notebook.display_id = <fun>

Modules

In [3]:
#load "Constants.cmo";;
#load_rec "Util.cma";;
#load_rec "Matrix.cmo";;
#load_rec "Simulation.cmo";;
#load_rec "Spindeterminant.cmo";;
#load_rec "Determinant.cmo";;
#load_rec "HartreeFock.cmo";;
#load_rec "MOBasis.cmo";;
#load_rec "F12CI.cmo";;

Printers

In [4]:
#install_printer AngularMomentum.pp_string ;;
#install_printer Basis.pp ;;
#install_printer Charge.pp ;;
#install_printer Coordinate.pp ;;
#install_printer Vector.pp;;
#install_printer Matrix.pp;;
#install_printer Util.pp_float_2darray;;
#install_printer Util.pp_float_array;;
#install_printer Util.pp_matrix;;
#install_printer HartreeFock.pp ;;
#install_printer Fock.pp ;;
#install_printer MOClass.pp ;;
let pp_mo ppf t = MOBasis.pp ~start:1 ~finish:0 ppf t ;;
#install_printer pp_mo;;
(*
#install_printer DeterminantSpace.pp;;
*)
#install_printer SpindeterminantSpace.pp;;
#install_printer Bitstring.pp;;

(* --------- *)

open Lacaml.D
Out[4]:
val pp_mo : Format.formatter -> MOBasis.t -> unit = <fun>

Run

Simulation

In [5]:
let basis_filename  = "/home/scemama/qp2/data/basis/6-31g" 
let aux_basis_filename = "/home/scemama/qp2/data/basis/cc-pvdz" 
let nuclei = Nuclei.of_zmt_string "c" 
let frozen_core = false
let multiplicity = 1
let state = 1

let basis =  Basis.of_nuclei_and_basis_filenames ~nuclei [basis_filename] 
let aux_basis =  Basis.of_nuclei_and_basis_filenames ~nuclei (basis_filename :: aux_basis_filename :: []) 
let f12 = F12factor.gaussian_geminal 1.0 
let charge = 0 


let simulation =
    Simulation.make 
        ~f12 ~charge ~multiplicity ~nuclei
        ~cartesian:true
        basis
Out[5]:
val basis_filename : string = "/home/scemama/qp2/data/basis/6-31g"
Out[5]:
val aux_basis_filename : string = "/home/scemama/qp2/data/basis/cc-pvdz"
Out[5]:
val nuclei : Nuclei.t = [|(Element.C,   0.0000   0.0000   0.0000)|]
Out[5]:
val frozen_core : bool = false
Out[5]:
val multiplicity : int = 1
Out[5]:
val state : int = 1
Out[5]:
val basis : Basis.t =
  
                          Atomic Basis set
                          ----------------

-----------------------------------------------------------------------
 #   Angular   Coordinates (Bohr)       Exponents       Coefficients
    Momentum  X        Y        Z
-----------------------------------------------------------------------
  1-3  S   0.0000   0.0000   0.0000   3.04752490e+03    1.83470000e-03
                                      4.57369510e+02    1.40373000e-02
                                      1.03948690e+02    6.88426000e-02
                                      2.92101550e+01    2.32184400e-01
                                      9.28666300e+00    4.67941300e-01
                                      3.16392700e+00    3.62312000e-01
                                    
                                      7.86827240e+00   -1.19332400e-01
                                      1.88128850e+00   -1.60854200e-01
                                      5.44249300e-01    1.14345640e+00
                                    
                                      1.68714400e-01    1.00000000e+00
                                    
                                    
-----------------------------------------------------------------------
  3-8  P   0.0000   0.0000   0.0000   7.86827240e+00    6.89991000e-02
                                      1.88128850e+00    3.16424000e-01
                                      5.44249300e-01    7.44308300e-01
                                    
                                      1.68714400e-01    1.00000000e+00
                                    
                                    
-----------------------------------------------------------------------

Out[5]:
val aux_basis : Basis.t =
  
                          Atomic Basis set
                          ----------------

-----------------------------------------------------------------------
 #   Angular   Coordinates (Bohr)       Exponents       Coefficients
    Momentum  X        Y        Z
-----------------------------------------------------------------------
  1-6  S   0.0000   0.0000   0.0000   3.04752490e+03    1.83470000e-03
                                      4.57369510e+02    1.40373000e-02
                                      1.03948690e+02    6.88426000e-02
                                      2.92101550e+01    2.32184400e-01
                                      9.28666300e+00    4.67941300e-01
                                      3.16392700e+00    3.62312000e-01
                                    
                                      7.86827240e+00   -1.19332400e-01
                                      1.88128850e+00   -1.60854200e-01
                                      5.44249300e-01    1.14345640e+00
                                    
                                      1.68714400e-01    1.00000000e+00
                                    
                                      6.66500000e+03    6.92000000e-04
                                      1.00000000e+03    5.32900000e-03
                                      2.28000000e+02    2.70770000e-02
                                      6.47100000e+01    1.01718000e-01
                                      2.10600000e+01    2.74740000e-01
                                      7.49500000e+00    4.48564000e-01
                                      2.79700000e+00    2.85074000e-01
                                      5.21500000e-01    1.52040000e-02
                                    
                                      6.66500000e+03   -1.46000000e-04
                                      1.00000000e+03   -1.15400000e-03
                                      2.28000000e+02   -5.72500000e-03
                                      6.47100000e+01   -2.33120000e-02
                                      2.10600000e+01   -6.39550000e-02
                                      7.49500000e+00   -1.49981000e-01
                                      2.79700000e+00   -1.27262000e-01
                                      5.21500000e-01    5.44529000e-01
                                    
                                      1.59600000e-01    1.00000000e+00
                                    
                                    
-----------------------------------------------------------------------
  3-14 P   0.0000   0.0000   0.0000   7.86827240e+00    6.89991000e-02
                                      1.88128850e+00    3.16424000e-01
                                      5.44249300e-01    7.44308300e-01
                                    
                                      1.68714400e-01    1.00000000e+00
                                    
                                      9.43900000e+00    3.81090000e-02
                                      2.00200000e+00    2.09480000e-01
                                      5.45600000e-01    5.08557000e-01
                                    
                                      1.51700000e-01    1.00000000e+00
                                    
                                    
-----------------------------------------------------------------------
 19-24 D   0.0000   0.0000   0.0000   5.50000000e-01    1.00000000e+00
                                    
                                    
-----------------------------------------------------------------------

Out[5]:
val f12 : F12factor.t =
  {F12factor.expo_s = 1.;
   gaussian =
    {GaussianOperator.coef_g =
      [  -0.314400  -0.303700  -0.168100  -0.098110  -0.060240  -0.037260 ];
     expo_sg =
      [   0.220900   1.004000   3.622000  12.160000  45.870000 254.400000 ];
     expo_sg_inv =
      [   4.526935   0.996016   0.276091   0.082237   0.021801   0.003931 ]}}
Out[5]:
val charge : int = 0
Out[5]:
val simulation : Simulation.t = <abstr>
In [6]:
let n_elec_alfa, n_elec_beta, n_elec = 
  let e =  Simulation.electrons simulation in
  Electrons.(n_alfa e, n_beta e, n_elec e)
Out[6]:
val n_elec_alfa : int = 3
val n_elec_beta : int = 3
val n_elec : int = 6

Hartree-Fock

In [7]:
let hf =  HartreeFock.make ~guess:`Hcore ~max_scf:1 simulation  ;;

let mo_basis = MOBasis.of_hartree_fock hf
15 significant shell pairs computed in 0.011017 seconds
1
2
5
6
Computed ERIs in 0.076355 seconds
MOs =


          -- 1 --      -- 2 --   -- 3 --     -- 4 --     -- 5 --
            1    0.995189    -0.236456        -0           0          -0
            2   0.0272807     0.573254        -0           0 3.53259E-15
            3           0  1.72951E-15 -0.367973   0.0766908    0.150337
                      ...          ...       ...         ...         ...
            7           0 -3.77874E-16 -0.187681    0.191376    0.736647
            8           0 -4.25307E-16 0.0510253    0.762647   -0.179253
            9           0            0  0.321637 -0.00931705    0.458283
      

            -- 6 --      -- 7 --     -- 8 --      -- 9 --
            1             0    0.0649868           0  6.10109E-16
            2   6.80132E-16     -1.62901 1.38666E-15 -3.01446E-15
            3      0.483484            0    0.286039      1.00059
                        ...          ...         ...          ...
            7     -0.577873  2.30797E-15   -0.225998    -0.693641
            8      0.157108 -1.58907E-15   -0.900616     0.168788
            9      0.990328  2.17391E-15   0.0110026    -0.431528
      
Out[7]:
val hf : HartreeFock.t = 
======================================================================
                        Restricted Hartree-Fock                      
======================================================================

    ------------------------------------------------------------
        #     HF energy       Convergence  HOMO-LUMO
    ------------------------------------------------------------
        1    -36.54848161      7.4861e-01     0.2723
    ------------------------------------------------------------


    ============================================================
               One-electron energy  -52.6699341214
                           Kinetic   42.4526747414
                         Potential  -95.1226088628
      --------------------------------------------------------  
               Two-electron energy   16.1214525119
                           Coulomb   21.8535619856
                          Exchange   -5.7321094737
      --------------------------------------------------------  
                           HF HOMO    0.8237517089
                           HF LUMO    8.2337216842
                      HF LUMO-LUMO    7.4099699753
      --------------------------------------------------------  
               Electronic   energy  -36.5484816095
               Nuclear   repulsion    0.0000000000
               Hartree-Fock energy  -36.5484816095
    ============================================================
    

Out[7]:
val mo_basis : MOBasis.t =
  Eigenvalues:   -11.127416    -0.632049    -0.269831     0.131526     0.151773 
            -- 1 --      -- 2 --   -- 3 --     -- 4 --     -- 5 --
      1    0.995189    -0.236456        -0           0          -0
      2   0.0272807     0.573254        -0           0 3.53259E-15
      3           0  1.72951E-15 -0.367973   0.0766908    0.150337
                ...          ...       ...         ...         ...
      7           0 -3.77874E-16 -0.187681    0.191376    0.736647
      8           0 -4.25307E-16 0.0510253    0.762647   -0.179253
      9           0            0  0.321637 -0.00931705    0.458283
  
  Eigenvalues:     0.786912     0.828231     0.869410     0.849164 
              -- 6 --      -- 7 --     -- 8 --      -- 9 --
      1             0    0.0649868           0  6.10109E-16
      2   6.80132E-16     -1.62901 1.38666E-15 -3.01446E-15
      3      0.483484            0    0.286039      1.00059
                  ...          ...         ...          ...
      7     -0.577873  2.30797E-15   -0.225998    -0.693641
      8      0.157108 -1.58907E-15   -0.900616     0.168788
      9      0.990328  2.17391E-15   0.0110026    -0.431528
  
  

FCI-F12

Notations:

  • $\langle ij || kl \rangle = \int \phi_i(r_1) \phi_j(r_2) \frac{1}{r_{12}} \phi_k(r1) \phi_l(r2) $
  • $\left[ ij || kl \right] = \int \phi_i(r_1) \phi_j(r_2) f_{12} \phi_k(r1) \phi_l(r2) $

Common functions

In [8]:
let f12 = Util.of_some @@ Simulation.f12 simulation 

let mo_num = MOBasis.size mo_basis 

let pp_spindet = Spindeterminant.pp mo_num

let pp_det = Determinant.pp mo_num

;;

#install_printer pp_spindet ;;
#install_printer pp_det ;;
Out[8]:
val f12 : F12factor.t =
  {F12factor.expo_s = 1.;
   gaussian =
    {GaussianOperator.coef_g =
      [  -0.314400  -0.303700  -0.168100  -0.098110  -0.060240  -0.037260 ];
     expo_sg =
      [   0.220900   1.004000   3.622000  12.160000  45.870000 254.400000 ];
     expo_sg_inv =
      [   4.526935   0.996016   0.276091   0.082237   0.021801   0.003931 ]}}
Out[8]:
val mo_num : int = 9
Out[8]:
val pp_spindet : Format.formatter -> Spindeterminant.t -> unit = <fun>
Out[8]:
val pp_det : Format.formatter -> Determinant.t -> unit = <fun>
In [9]:
let simulation_aux = 
    let charge        = Charge.to_int @@ Simulation.charge simulation 
    and multiplicity  = Electrons.multiplicity @@ Simulation.electrons simulation
    and nuclei        = Simulation.nuclei simulation
    in
    let general_basis = 
      Basis.general_basis @@ Simulation.basis simulation
    in
    GeneralBasis.combine [
      general_basis ; GeneralBasis.read aux_basis_filename
    ]
    |> Basis.of_nuclei_and_general_basis nuclei
    |> Simulation.make ~f12 ~charge ~multiplicity ~nuclei 


let aux_basis = 
  MOBasis.of_mo_basis simulation_aux mo_basis

let aux_num = 
  MOBasis.size aux_basis
Out[9]:
val simulation_aux : Simulation.t = <abstr>
66 significant shell pairs computed in 0.117263 seconds
1
2
5
6
9
10
11
12
15
18
Computed ERIs in 1.977485 seconds
Out[9]:
val aux_basis : MOBasis.t =
  Eigenvalues:   -11.127416    -0.632049    -0.269831     0.131526     0.151773 
                -- 1 --     -- 2 --      -- 3 --      -- 4 --      -- 5 --
       1       0.995189   -0.236456 -1.73798E-11 -5.89341E-12 -7.00418E-13
       2      0.0272807    0.573254 -3.89444E-12  2.27307E-12 -2.56432E-12
       3   -1.94384E-12 1.73346E-12    -0.367973    0.0766908     0.150337
                    ...         ...          ...          ...          ...
      22              0           0           -0            0           -0
      23              0           0           -0            0           -0
      24              0           0           -0            0           -0
  
  Eigenvalues:     0.786912     0.828231     0.869410     0.849164     1.466632 
               -- 6 --    -- 7 --      -- 8 --      -- 9 --     -- 10 --
       1   1.50201E-11  0.0649868  -3.9865E-12 -2.80092E-12  5.89337E-13
       2   2.08028E-12   -1.62901  7.48425E-13  4.96652E-12  4.15331E-13
       3      0.483484 1.0051E-12     0.286039      1.00059 -1.60551E-12
                   ...        ...          ...          ...          ...
      22             0          0            0           -0     0.866025
      23             0          0            0           -0           -0
      24   5.27744E-16          0 -5.11589E-16  -4.6158E-16           -0
  
  Eigenvalues:     1.070084     1.070805     1.081067     1.500877    25.850974 
               -- 11 --     -- 12 --     -- 13 --    -- 14 --    -- 15 --
       1   -5.48487E-10 -1.11498E-09  6.09785E-10     5.77229 1.19123E-08
       2   -1.94824E-10  3.47046E-11  4.11568E-12     -21.703 -1.7907E-09
       3       -9.41452      3.69747    -0.652915 2.28347E-11    -103.655
                    ...          ...          ...         ...         ...
      22   -6.92158E-15   2.3024E-14  3.73394E-14           0 3.94749E-13
      23              0           -0           -0           0           0
      24    1.42625E-14 -4.63583E-14 -7.19444E-14           0 -7.7113E-13
  
  Eigenvalues:    25.897153    25.860606    17.895130   378.235808     1.482313 
               -- 16 --     -- 17 --    -- 18 --     -- 19 --     -- 20 --
       1   -1.21774E-08  -2.0721E-08     20.5865      436.893 -2.71241E-11
       2   -3.08076E-09 -3.38442E-10    -125.907     -12.7961  9.93073E-13
       3       -138.626      11.0904 3.97511E-09 -1.32873E-09  8.64773E-11
                    ...          ...         ...          ...          ...
      22   -5.51091E-13  5.33938E-13          -0            0    -0.499824
      23              0            0          -0  4.37638E-12  0.000428597
      24    1.08133E-12 -1.06903E-12          -0            0     0.999649
  
  Eigenvalues:     1.473167     1.473619     1.476138 
               -- 21 --     -- 22 --     -- 23 --
       1    3.94644E-11  1.23634E-12 -1.91389E-09
       2   -1.44545E-12 -4.52649E-14  7.01117E-11
       3   -6.03758E-12  3.46113E-12            0
                    ...          ...          ...
      22     -0.0123761   0.00474354  -3.1708E-05
      23     -0.0204084  -0.00140208     0.999791
      24      0.0247521  -0.00948708  6.34159E-05
  
  
Out[9]:
val aux_num : int = 23
In [10]:
let () = ignore @@ MOBasis.f12_ints   aux_basis
let () = ignore @@ MOBasis.two_e_ints aux_basis
66 significant shell pairs computed in 1.632481 seconds
1
2
5
6
9
10
11
12
15
18
Computed ERIs in 32.827461 seconds
4-idx transformation 
23 / 23
4-idx transformation 
23 / 23

Integral-based functions

\begin{equation} \langle I | \hat{H} | J \rangle = \begin{cases} \sum_i h_{ii} + \frac{1}{2} \sum_{ij} \langle ij || ij \rangle \text{ when } |J\rangle = |I\rangle \\ h_{ik} + \sum_{j} \langle ij || kj \rangle \text{ when } |J\rangle = \hat{T}_i^k |I\rangle \\ \langle ij || kl \rangle \text{ when } |J\rangle = \hat{T}_{ij}^{kl} |I\rangle \\ \end{cases} \end{equation}\begin{equation} \langle I | \hat{F} | J \rangle = \begin{cases} \sum_i f_{ii} + \frac{1}{2} \sum_{ij} \langle ij || ij \rangle \text{ when } |J\rangle = |I\rangle \\ f_{ik} + \sum_{j} \langle ij || kj \rangle \text{ when } |J\rangle = \hat{T}_i^k |I\rangle \\ \langle ij || kl \rangle \text{ when } |J\rangle = \hat{T}_{ij}^{kl} |I\rangle \\ \end{cases} \end{equation}
In [11]:
let cancel_singles = false 

let mos_cabs = 
  Util.list_range (mo_num+1) aux_num
  
let mos_abs = 
  Util.list_range 1 aux_num
  
let mos_in = 
  Util.list_range 1 mo_num

let mos_a k =
  Determinant.alfa k
  |> Spindeterminant.to_list
  
let mos_b k =
  Determinant.beta k
  |> Spindeterminant.to_list
Out[11]:
val cancel_singles : bool = false
Out[11]:
val mos_cabs : int list =
  [10; 11; 12; 13; 14; 15; 16; 17; 18; 19; 20; 21; 22; 23]
Out[11]:
val mos_abs : int list =
  [1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16; 17; 18; 19; 20; 21;
   22; 23]
Out[11]:
val mos_in : int list = [1; 2; 3; 4; 5; 6; 7; 8; 9]
Out[11]:
val mos_a : Determinant.t -> int list = <fun>
Out[11]:
val mos_b : Determinant.t -> int list = <fun>

H integrals

In [12]:
let h_one =
  let h = 
    MOBasis.one_e_ints aux_basis
  in fun i j _ -> h.{i,j}
  
let h_two = 
  let two_e_ints = MOBasis.two_e_ints aux_basis in
  let h2 i j k l (s:Spin.t) (s':Spin.t) =
    if s' <> s then
        ERI.get_phys two_e_ints i j k l
    else
        (ERI.get_phys two_e_ints i j k l) -.                                                 
        (ERI.get_phys two_e_ints i j l k)
  in
  h2
Out[12]:
val h_one : int -> int -> '_weak1 -> float = <fun>
Out[12]:
val h_two : int -> int -> int -> int -> Spin.t -> Spin.t -> float = <fun>

F12 integrals

In [13]:
let f_two = 
  let two_e_ints = MOBasis.f12_ints aux_basis in
  let f2 i j k l (s:Spin.t) (s':Spin.t) =
    if s' <> s then
        0.5 *. F12.get_phys two_e_ints i j k l
    else
        0.5 *. (
         (F12.get_phys two_e_ints i j k l) -.                                                 
         (F12.get_phys two_e_ints i j l k) )
  in
  let f3 i j k l (s:Spin.t) (s':Spin.t) = 
      if (i=k && j<>l) || (j=l && i<>k) then
        0.
      else
        f2 i j k l s s'
  in
  if cancel_singles then f3 else f2

let f_one = fun _ _ _ -> 0.

(*
let f_two = h_two

let f_one = h_one
*)
Out[13]:
val f_two : int -> int -> int -> int -> Spin.t -> Spin.t -> float = <fun>
Out[13]:
val f_one : 'a -> 'b -> 'c -> float = <fun>

Determinant-based functions

Integrals

In [14]:
let f12_integrals mo_basis =
  ( f_one, f_two, None )

let h_ij mo_basis ki kj =
  let integrals =
    List.map (fun f -> f mo_basis)
      [ CI.h_integrals ]
  in
  CIMatrixElement.make integrals ki kj 
  |> List.hd


let f_ij mo_basis ki kj =
  let integrals =
    List.map (fun f -> f mo_basis)
      [ f12_integrals ]
  in
  CIMatrixElement.make integrals ki kj 
  |> List.hd                                                                                  


let hf_ij mo_basis ki kj =
  let integrals =
    List.map (fun f -> f mo_basis)
      [ CI.h_integrals ; f12_integrals ]
  in
  CIMatrixElement.make integrals ki kj
Out[14]:
val f12_integrals :
  'a ->
  ('b -> 'c -> 'd -> float) *
  (int -> int -> int -> int -> Spin.t -> Spin.t -> float) * 'e option = <fun>
Out[14]:
val h_ij : MOBasis.t -> CIMatrixElement.De.t -> CIMatrixElement.De.t -> float =
  <fun>
Out[14]:
val f_ij : 'a -> CIMatrixElement.De.t -> CIMatrixElement.De.t -> float =
  <fun>
Out[14]:
val hf_ij :
  MOBasis.t -> CIMatrixElement.De.t -> CIMatrixElement.De.t -> float list =
  <fun>

Determinant space

In [15]:
let is_a_double det_space =
    let mo_class = DeterminantSpace.mo_class det_space in
    let mo_num = Array.length @@ MOClass.mo_class_array mo_class in
    let m l =
      List.fold_left (fun accu i ->
          let j = i-1 in Bitstring.logor accu (Bitstring.shift_left_one mo_num j)
        ) (Bitstring.zero mo_num) l
    in
    let aux_mask   = m (MOClass.auxiliary_mos mo_class) in
    fun k ->                                                                                  
      let alfa =
        Determinant.alfa k
        |> Spindeterminant.bitstring
      in
      let beta =
        Determinant.beta k
        |> Spindeterminant.bitstring
      in
      let a = Bitstring.logand aux_mask alfa
      and b = Bitstring.logand aux_mask beta
      in
      match Bitstring.popcount a + Bitstring.popcount b with
      | 2 | 1 -> true
      | 0 | _ -> false
Out[15]:
val is_a_double : DeterminantSpace.t -> Determinant.t -> bool = <fun>
In [16]:
let in_space = 
    DeterminantSpace.fci_f12_of_mo_basis aux_basis ~frozen_core mo_num
    
let aux_space = 
    DeterminantSpace.fci_of_mo_basis aux_basis ~frozen_core 

let det_space_in () =
    DeterminantSpace.determinant_stream in_space

let det_space_out () =
    let s = 
        DeterminantSpace.determinant_stream aux_space
    in
    Stream.from (fun _ ->
        try
          let is_a_double = is_a_double in_space in
          let rec result () =
            let ki = Stream.next s in
            if is_a_double ki then
              Some (ki,ki)
            else
              result ()
          in
          result ()
        with Stream.Failure -> None
      )
Number of determinants : 84 84 7056
Out[16]:
val in_space : DeterminantSpace.t = <abstr>
Number of determinants : 1771 1771 3136441
Out[16]:
val aux_space : DeterminantSpace.t = <abstr>
Out[16]:
val det_space_in : unit -> Determinant.t Stream.t = <fun>
Out[16]:
val det_space_out : unit -> (Determinant.t * Determinant.t) Stream.t = <fun>
In [17]:
let ci = CI.make ~n_states:state in_space

let ci_coef, ci_energy = Lazy.force ci.eigensystem 

let _ = print_newline ()
Out[17]:
val ci : CI.t =
  {CI.e_shift = -37.5503735182818161; det_space = <abstr>; m_H = <lazy>;
   m_S2 = <lazy>; eigensystem = <lazy>; n_states = 1}
  1     0.0000000000    4.27876360e-01
  2    -0.0892428570    1.30475542e-01
  3    -0.0992140799    8.74622675e-02
  4    -0.1022422032    2.82063712e-02
  5    -0.1043598763    3.75067204e-02
  6    -0.1065557047    4.71900892e-02
  7    -0.1080257392    1.17050936e-02
  8    -0.1082438239    4.19578866e-03
  0    -0.1082636731    1.74312968e-03
  1    -0.1082673304    7.12907991e-04
  2    -0.1082677273    3.29773895e-04
  3    -0.1082677955    1.62017305e-04
  4    -0.1082678250    1.97376527e-04
  5    -0.1082678653    1.65667298e-04
  6    -0.1082678853    1.24231373e-04
  7    -0.1082678901    1.06697885e-05
  8    -0.1082678902    5.05286976e-06
  0    -0.1082678902    2.52891309e-06
Out[17]:
val ci_coef : Lacaml.D.Mat.t =
  

                -- 1 --
           1      -0.780949
           2             -0
           3             -0
                        ...
        7054             -0
        7055             -0
        7056   -3.12865E-06
  
val ci_energy : Lacaml.D.Vec.t =
        R1       R2       R3
  -37.6586 -36.7238 -36.2286
  1    -0.1082678902    4.37908381e-07

Out[17]:
- : unit = ()

Permutation operator $p_{12}$ that generates a new determinant with electrons 1 and 2 swapped.

let p12 det_space = let mo_class = DeterminantSpace.mo_class det_space in let mo_num = Array.length @@ MOClass.mo_class_array mo_class in let m l = List.fold_left (fun accu i -> let j = i-1 in Bitstring.logor accu (Bitstring.shift_left_one mo_num j) ) (Bitstring.zero mo_num) l in let aux_mask = m (MOClass.auxiliary_mos mo_class) in let not_aux_mask = Bitstring.(shift_left_one mo_num (mo_num-1) |> minus_one |> logxor aux_mask) in fun k -> let alfa = Determinant.alfa k |> Spindeterminant.bitstring in let beta = Determinant.beta k |> Spindeterminant.bitstring in let a = Bitstring.logand aux_mask alfa and b = Bitstring.logand aux_mask beta in match Bitstring.popcount a, Bitstring.popcount b with | 2, 0 | 0, 2 -> Some (Determinant.negate_phase k) | 1, 1 -> Some (Determinant.of_spindeterminants (Spindeterminant.of_bitstring @@ Bitstring.(logor b (logand not_aux_mask alfa)) ) (Spindeterminant.of_bitstring @@ Bitstring.(logor a (logand not_aux_mask beta)) ) ) | 1, 0 | 0, 1 -> Some k | _ -> None

Matrices $\langle I | H | \alpha \rangle$ and $\langle I | F | \alpha \rangle$

In [123]:
let randomize = false

let out_list =
    Util.stream_to_list (det_space_out ())
    
let in_list =
    Util.stream_to_list (det_space_in ())
    
let det_a = Array.of_list out_list
            |> Array.map (fun (i,_) -> i)

let det_I =
  if randomize then
    let n = 123456789 in
    in_list
    |> List.map (fun k -> (Random.int n, k))
    |> List.sort compare
    |> List.map  (fun (_,k) -> k)
    |> Array.of_list
  else
    Array.of_list in_list
Out[123]:
val randomize : bool = false
Out[123]:
val out_list : (Determinant.t * Determinant.t) list =
  [(phase:+1
    a:+1 ++-------+------------------------------------------------------
    b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 ++-------+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 +-+------+------------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 +-+------+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 -++------+------------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 -++------+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 +--+-----+------------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 +--+-----+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 -+-+-----+------------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 -+-+-----+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 --++-----+------------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 --++-----+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 +---+----+------------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 +---+----+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 -+--+----+------------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 -+--+----+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 --+-+----+------------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 --+-+----+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 ---++----+------------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 ---++----+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 +----+---+------------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 +----+---+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 -+---+---+------------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 -+---+---+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 --+--+---+------------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 --+--+---+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 ---+-+---+------------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 ---+-+---+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 ----++---+------------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 ----++---+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 +-----+--+------------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 +-----+--+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 -+----+--+------------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 -+----+--+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 --+---+--+------------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 --+---+--+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 ---+--+--+------------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 ---+--+--+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 ----+-+--+------------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 ----+-+--+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 -----++--+------------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 -----++--+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 +------+-+------------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 +------+-+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 -+-----+-+------------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 -+-----+-+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 --+----+-+------------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 --+----+-+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 ---+---+-+------------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 ---+---+-+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 ----+--+-+------------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 ----+--+-+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 -----+-+-+------------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 -----+-+-+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 ------++-+------------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 ------++-+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 +-------++------------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 +-------++------------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 -+------++------------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 -+------++------------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 --+-----++------------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 --+-----++------------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 ---+----++------------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 ---+----++------------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 ----+---++------------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 ----+---++------------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 -----+--++------------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 -----+--++------------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 ------+-++------------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 ------+-++------------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 -------+++------------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 -------+++------------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 ++--------+-----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 ++--------+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 +-+-------+-----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 +-+-------+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 -++-------+-----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 -++-------+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 +--+------+-----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 +--+------+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 -+-+------+-----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 -+-+------+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 --++------+-----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 --++------+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 +---+-----+-----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 +---+-----+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 -+--+-----+-----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 -+--+-----+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 --+-+-----+-----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 --+-+-----+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 ---++-----+-----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 ---++-----+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 +----+----+-----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 +----+----+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 -+---+----+-----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 -+---+----+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 --+--+----+-----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 --+--+----+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 ---+-+----+-----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 ---+-+----+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 ----++----+-----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 ----++----+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 +-----+---+-----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 +-----+---+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 -+----+---+-----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 -+----+---+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 --+---+---+-----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 --+---+---+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 ---+--+---+-----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 ---+--+---+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 ----+-+---+-----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 ----+-+---+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 -----++---+-----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 -----++---+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 +------+--+-----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 +------+--+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 -+-----+--+-----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 -+-----+--+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 --+----+--+-----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 --+----+--+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 ---+---+--+-----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 ---+---+--+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 ----+--+--+-----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 ----+--+--+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 -----+-+--+-----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 -----+-+--+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 ------++--+-----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 ------++--+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 +-------+-+-----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 +-------+-+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 -+------+-+-----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 -+------+-+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 --+-----+-+-----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 --+-----+-+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 ---+----+-+-----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 ---+----+-+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 ----+---+-+-----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 ----+---+-+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 -----+--+-+-----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 -----+--+-+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 ------+-+-+-----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 ------+-+-+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 -------++-+-----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 -------++-+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 +--------++-----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 +--------++-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 -+-------++-----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 -+-------++-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 --+------++-----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 --+------++-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 ---+-----++-----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 ---+-----++-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 ----+----++-----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 ----+----++-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 -----+---++-----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 -----+---++-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 ------+--++-----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 ------+--++-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 -------+-++-----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 -------+-++-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 --------+++-----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 --------+++-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 ++---------+----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 ++---------+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 +-+--------+----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 +-+--------+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 -++--------+----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 -++--------+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 +--+-------+----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 +--+-------+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 -+-+-------+----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 -+-+-------+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 --++-------+----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 --++-------+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 +---+------+----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 +---+------+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 -+--+------+----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 -+--+------+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 --+-+------+----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 --+-+------+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 ---++------+----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 ---++------+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 +----+-----+----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 +----+-----+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 -+---+-----+----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 -+---+-----+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 --+--+-----+----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 --+--+-----+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 ---+-+-----+----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 ---+-+-----+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 ----++-----+----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 ----++-----+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 +-----+----+----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 +-----+----+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 -+----+----+----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 -+----+----+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 --+---+----+----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
,
phase:+1
a:+1 --+---+----+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
);
(phase:+1
 a:+1 ---+--+----+----------------------------------------------------
 b:+1 +++-------------------------------------------------------------
, ...);
...]
Out[123]:
val in_list : Determinant.t list =
  [phase:+1
   a:+1 +++-------------------------------------------------------------
   b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ++-+------------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +-++------------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+++------------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ++--+-----------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +-+-+-----------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -++-+-----------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +--++-----------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+-++-----------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+++-----------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ++---+----------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +-+--+----------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -++--+----------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +--+-+----------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+-+-+----------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --++-+----------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +---++----------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+--++----------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+-++----------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+++----------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ++----+---------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +-+---+---------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -++---+---------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +--+--+---------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+-+--+---------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --++--+---------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +---+-+---------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+--+-+---------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+-+-+---------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---++-+---------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +----++---------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+---++---------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+--++---------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+-++---------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ----+++---------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ++-----+--------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +-+----+--------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -++----+--------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +--+---+--------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+-+---+--------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --++---+--------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +---+--+--------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+--+--+--------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+-+--+--------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---++--+--------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +----+-+--------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+---+-+--------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+--+-+--------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+-+-+--------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ----++-+--------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +-----++--------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+----++--------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+---++--------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+--++--------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ----+-++--------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -----+++--------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ++------+-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +-+-----+-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -++-----+-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +--+----+-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+-+----+-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --++----+-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +---+---+-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+--+---+-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+-+---+-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---++---+-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +----+--+-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+---+--+-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+--+--+-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+-+--+-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ----++--+-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +-----+-+-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+----+-+-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+---+-+-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+--+-+-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ----+-+-+-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -----++-+-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +------++-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+-----++-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+----++-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+---++-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ----+--++-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -----+-++-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ------+++-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +++-------------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ++-+------------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 +-++------------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -+++------------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ++--+-----------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 +-+-+-----------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -++-+-----------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 +--++-----------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -+-++-----------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 --+++-----------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ++---+----------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 +-+--+----------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -++--+----------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 +--+-+----------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -+-+-+----------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 --++-+----------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 +---++----------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -+--++----------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 --+-++----------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ---+++----------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ++----+---------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 +-+---+---------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -++---+---------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 +--+--+---------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -+-+--+---------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 --++--+---------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 +---+-+---------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -+--+-+---------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 --+-+-+---------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ---++-+---------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 +----++---------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -+---++---------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 --+--++---------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ---+-++---------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ----+++---------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ++-----+--------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 +-+----+--------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -++----+--------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 +--+---+--------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -+-+---+--------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 --++---+--------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 +---+--+--------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -+--+--+--------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 --+-+--+--------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ---++--+--------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 +----+-+--------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -+---+-+--------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 --+--+-+--------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ---+-+-+--------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ----++-+--------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 +-----++--------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -+----++--------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 --+---++--------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ---+--++--------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ----+-++--------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -----+++--------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ++------+-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 +-+-----+-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -++-----+-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 +--+----+-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -+-+----+-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 --++----+-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 +---+---+-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -+--+---+-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 --+-+---+-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ---++---+-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 +----+--+-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -+---+--+-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 --+--+--+-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ---+-+--+-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ----++--+-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 +-----+-+-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -+----+-+-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 --+---+-+-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ---+--+-+-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ----+-+-+-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -----++-+-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 +------++-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -+-----++-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 --+----++-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ---+---++-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ----+--++-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -----+-++-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ------+++-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 +++-------------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ++-+------------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 +-++------------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -+++------------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ++--+-----------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 +-+-+-----------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -++-+-----------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 +--++-----------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -+-++-----------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 --+++-----------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ++---+----------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 +-+--+----------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -++--+----------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 +--+-+----------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -+-+-+----------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 --++-+----------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 +---++----------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -+--++----------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 --+-++----------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ---+++----------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ++----+---------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 +-+---+---------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -++---+---------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 +--+--+---------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -+-+--+---------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 --++--+---------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 +---+-+---------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -+--+-+---------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 --+-+-+---------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ---++-+---------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 +----++---------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -+---++---------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 --+--++---------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ---+-++---------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ----+++---------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ++-----+--------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 +-+----+--------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -++----+--------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 +--+---+--------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -+-+---+--------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 --++---+--------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 +---+--+--------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -+--+--+--------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 --+-+--+--------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ---++--+--------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 +----+-+--------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -+---+-+--------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 --+--+-+--------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ---+-+-+--------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ----++-+--------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 +-----++--------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -+----++--------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 --+---++--------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ---+--++--------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ----+-++--------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -----+++--------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ++------+-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 +-+-----+-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -++-----+-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 +--+----+-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -+-+----+-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 --++----+-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 +---+---+-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -+--+---+-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 --+-+---+-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ---++---+-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 +----+--+-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -+---+--+-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 --+--+--+-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ---+-+--+-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ----++--+-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 +-----+-+-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -+----+-+-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 --+---+-+-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ---+--+-+-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ----+-+-+-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -----++-+-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 +------++-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -+-----++-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 --+----++-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ---+---++-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ----+--++-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -----+-++-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ------+++-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 +++-------------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 ++-+------------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 +-++------------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 -+++------------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 ++--+-----------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 +-+-+-----------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 -++-+-----------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 +--++-----------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 -+-++-----------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 --+++-----------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 ++---+----------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 +-+--+----------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 -++--+----------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 +--+-+----------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 -+-+-+----------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 --++-+----------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 +---++----------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 -+--++----------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 --+-++----------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 ---+++----------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 ++----+---------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 +-+---+---------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 -++---+---------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 +--+--+---------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 -+-+--+---------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 --++--+---------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 +---+-+---------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 -+--+-+---------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 --+-+-+---------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 ---++-+---------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 +----++---------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 -+---++---------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 --+--++---------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 ---+-++---------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 ----+++---------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 ++-----+--------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 +-+----+--------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 -++----+--------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 +--+---+--------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 -+-+---+--------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 --++---+--------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 +---+--+--------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 -+--+--+--------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 --+-+--+--------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 ---++--+--------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 +----+-+--------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 -+---+-+--------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
...]
Out[123]:
val det_a : Determinant.t array =
  [|phase:+1
    a:+1 ++-------+------------------------------------------------------
    b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +-+------+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -++------+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +--+-----+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+-+-----+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --++-----+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +---+----+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+--+----+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+-+----+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---++----+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +----+---+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+---+---+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+--+---+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+-+---+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ----++---+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +-----+--+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+----+--+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+---+--+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+--+--+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ----+-+--+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -----++--+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +------+-+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+-----+-+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+----+-+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+---+-+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ----+--+-+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -----+-+-+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ------++-+------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +-------++------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+------++------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+-----++------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+----++------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ----+---++------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -----+--++------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ------+-++------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -------+++------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ++--------+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +-+-------+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -++-------+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +--+------+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+-+------+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --++------+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +---+-----+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+--+-----+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+-+-----+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---++-----+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +----+----+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+---+----+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+--+----+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+-+----+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ----++----+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +-----+---+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+----+---+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+---+---+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+--+---+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ----+-+---+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -----++---+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +------+--+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+-----+--+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+----+--+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+---+--+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ----+--+--+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -----+-+--+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ------++--+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +-------+-+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+------+-+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+-----+-+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+----+-+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ----+---+-+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -----+--+-+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ------+-+-+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -------++-+-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +--------++-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+-------++-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+------++-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+-----++-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ----+----++-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -----+---++-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ------+--++-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -------+-++-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --------+++-----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ++---------+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +-+--------+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -++--------+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +--+-------+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+-+-------+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --++-------+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +---+------+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+--+------+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+-+------+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---++------+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +----+-----+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+---+-----+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+--+-----+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+-+-----+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ----++-----+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +-----+----+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+----+----+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+---+----+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+--+----+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ----+-+----+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -----++----+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +------+---+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+-----+---+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+----+---+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+---+---+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ----+--+---+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -----+-+---+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ------++---+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +-------+--+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+------+--+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+-----+--+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+----+--+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ----+---+--+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -----+--+--+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ------+-+--+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -------++--+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +--------+-+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+-------+-+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+------+-+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+-----+-+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ----+----+-+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -----+---+-+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ------+--+-+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -------+-+-+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --------++-+----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +---------++----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+--------++----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+-------++----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+------++----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ----+-----++----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -----+----++----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ------+---++----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -------+--++----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --------+-++----------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ++----------+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +-+---------+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -++---------+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +--+--------+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+-+--------+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --++--------+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +---+-------+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+--+-------+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+-+-------+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---++-------+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +----+------+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+---+------+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+--+------+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+-+------+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ----++------+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +-----+-----+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+----+-----+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+---+-----+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+--+-----+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ----+-+-----+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -----++-----+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +------+----+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+-----+----+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+----+----+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+---+----+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ----+--+----+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -----+-+----+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ------++----+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +-------+---+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+------+---+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+-----+---+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+----+---+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ----+---+---+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -----+--+---+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ------+-+---+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -------++---+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +--------+--+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+-------+--+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+------+--+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+-----+--+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ----+----+--+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -----+---+--+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ------+--+--+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -------+-+--+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --------++--+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +---------+-+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+--------+-+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+-------+-+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+------+-+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ----+-----+-+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -----+----+-+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ------+---+-+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -------+--+-+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --------+-+-+---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +----------++---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+---------++---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+--------++---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+-------++---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ----+------++---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -----+-----++---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ------+----++---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -------+---++---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --------+--++---------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ++-----------+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +-+----------+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -++----------+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +--+---------+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+-+---------+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --++---------+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +---+--------+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+--+--------+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+-+--------+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---++--------+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +----+-------+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+---+-------+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+--+-------+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+-+-------+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ----++-------+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +-----+------+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+----+------+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+---+------+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+--+------+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ----+-+------+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -----++------+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +------+-----+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+-----+-----+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+----+-----+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+---+-----+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ----+--+-----+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -----+-+-----+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ------++-----+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +-------+----+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+------+----+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+-----+----+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+----+----+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ----+---+----+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -----+--+----+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ------+-+----+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -------++----+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +--------+---+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+-------+---+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+------+---+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+-----+---+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ----+----+---+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -----+---+---+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ------+--+---+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -------+-+---+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --------++---+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +---------+--+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+--------+--+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+-------+--+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+------+--+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ----+-----+--+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -----+----+--+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ------+---+--+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -------+--+--+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --------+-+--+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +----------+-+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+---------+-+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+--------+-+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+-------+-+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ----+------+-+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -----+-----+-+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ------+----+-+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -------+---+-+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --------+--+-+--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +-----------++--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+----------++--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+---------++--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+--------++--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ----+-------++--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -----+------++--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ------+-----++--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -------+----++--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --------+---++--------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ++------------+-------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +-+-----------+-------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -++-----------+-------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +--+----------+-------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+-+----------+-------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --++----------+-------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +---+---------+-------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+--+---------+-------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+-+---------+-------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---++---------+-------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +----+--------+-------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+---+--------+-------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+--+--------+-------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+-+--------+-------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ----++--------+-------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +-----+-------+-------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+----+-------+-------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+---+-------+-------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+--+-------+-------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ----+-+-------+-------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -----++-------+-------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +------+------+-------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+-----+------+-------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+----+------+-------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+---+------+-------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ----+--+------+-------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -----+-+------+-------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ------++------+-------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +-------+-----+-------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
...|]
Out[123]:
val det_I : Determinant.t array =
  [|phase:+1
    a:+1 +++-------------------------------------------------------------
    b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ++-+------------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +-++------------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+++------------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ++--+-----------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +-+-+-----------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -++-+-----------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +--++-----------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+-++-----------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+++-----------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ++---+----------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +-+--+----------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -++--+----------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +--+-+----------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+-+-+----------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --++-+----------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +---++----------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+--++----------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+-++----------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+++----------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ++----+---------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +-+---+---------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -++---+---------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +--+--+---------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+-+--+---------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --++--+---------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +---+-+---------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+--+-+---------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+-+-+---------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---++-+---------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +----++---------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+---++---------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+--++---------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+-++---------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ----+++---------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ++-----+--------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +-+----+--------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -++----+--------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +--+---+--------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+-+---+--------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --++---+--------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +---+--+--------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+--+--+--------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+-+--+--------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---++--+--------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +----+-+--------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+---+-+--------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+--+-+--------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+-+-+--------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ----++-+--------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +-----++--------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+----++--------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+---++--------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+--++--------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ----+-++--------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -----+++--------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ++------+-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +-+-----+-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -++-----+-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +--+----+-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+-+----+-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --++----+-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +---+---+-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+--+---+-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+-+---+-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---++---+-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +----+--+-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+---+--+-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+--+--+-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+-+--+-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ----++--+-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +-----+-+-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+----+-+-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+---+-+-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+--+-+-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ----+-+-+-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -----++-+-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +------++-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -+-----++-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 --+----++-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ---+---++-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ----+--++-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 -----+-++-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 ------+++-------------------------------------------------------
b:+1 +++-------------------------------------------------------------
;
phase:+1
a:+1 +++-------------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ++-+------------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 +-++------------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -+++------------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ++--+-----------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 +-+-+-----------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -++-+-----------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 +--++-----------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -+-++-----------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 --+++-----------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ++---+----------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 +-+--+----------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -++--+----------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 +--+-+----------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -+-+-+----------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 --++-+----------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 +---++----------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -+--++----------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 --+-++----------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ---+++----------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ++----+---------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 +-+---+---------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -++---+---------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 +--+--+---------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -+-+--+---------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 --++--+---------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 +---+-+---------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -+--+-+---------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 --+-+-+---------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ---++-+---------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 +----++---------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -+---++---------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 --+--++---------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ---+-++---------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ----+++---------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ++-----+--------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 +-+----+--------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -++----+--------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 +--+---+--------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -+-+---+--------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 --++---+--------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 +---+--+--------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -+--+--+--------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 --+-+--+--------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ---++--+--------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 +----+-+--------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -+---+-+--------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 --+--+-+--------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ---+-+-+--------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ----++-+--------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 +-----++--------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -+----++--------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 --+---++--------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ---+--++--------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ----+-++--------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -----+++--------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ++------+-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 +-+-----+-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -++-----+-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 +--+----+-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -+-+----+-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 --++----+-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 +---+---+-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -+--+---+-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 --+-+---+-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ---++---+-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 +----+--+-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -+---+--+-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 --+--+--+-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ---+-+--+-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ----++--+-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 +-----+-+-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -+----+-+-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 --+---+-+-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ---+--+-+-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ----+-+-+-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -----++-+-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 +------++-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -+-----++-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 --+----++-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ---+---++-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ----+--++-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 -----+-++-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 ------+++-------------------------------------------------------
b:+1 ++-+------------------------------------------------------------
;
phase:+1
a:+1 +++-------------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ++-+------------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 +-++------------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -+++------------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ++--+-----------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 +-+-+-----------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -++-+-----------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 +--++-----------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -+-++-----------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 --+++-----------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ++---+----------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 +-+--+----------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -++--+----------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 +--+-+----------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -+-+-+----------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 --++-+----------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 +---++----------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -+--++----------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 --+-++----------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ---+++----------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ++----+---------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 +-+---+---------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -++---+---------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 +--+--+---------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -+-+--+---------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 --++--+---------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 +---+-+---------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -+--+-+---------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 --+-+-+---------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ---++-+---------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 +----++---------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -+---++---------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 --+--++---------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ---+-++---------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ----+++---------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ++-----+--------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 +-+----+--------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -++----+--------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 +--+---+--------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -+-+---+--------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 --++---+--------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 +---+--+--------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -+--+--+--------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 --+-+--+--------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ---++--+--------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 +----+-+--------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -+---+-+--------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 --+--+-+--------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ---+-+-+--------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ----++-+--------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 +-----++--------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -+----++--------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 --+---++--------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ---+--++--------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ----+-++--------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -----+++--------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ++------+-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 +-+-----+-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -++-----+-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 +--+----+-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -+-+----+-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 --++----+-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 +---+---+-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -+--+---+-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 --+-+---+-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ---++---+-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 +----+--+-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -+---+--+-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 --+--+--+-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ---+-+--+-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ----++--+-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 +-----+-+-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -+----+-+-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 --+---+-+-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ---+--+-+-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ----+-+-+-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -----++-+-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 +------++-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -+-----++-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 --+----++-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ---+---++-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ----+--++-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 -----+-++-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 ------+++-------------------------------------------------------
b:+1 +-++------------------------------------------------------------
;
phase:+1
a:+1 +++-------------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 ++-+------------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 +-++------------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 -+++------------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 ++--+-----------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 +-+-+-----------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 -++-+-----------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 +--++-----------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 -+-++-----------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 --+++-----------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 ++---+----------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 +-+--+----------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 -++--+----------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 +--+-+----------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 -+-+-+----------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 --++-+----------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 +---++----------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 -+--++----------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 --+-++----------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 ---+++----------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 ++----+---------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 +-+---+---------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 -++---+---------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 +--+--+---------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 -+-+--+---------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 --++--+---------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 +---+-+---------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 -+--+-+---------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 --+-+-+---------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 ---++-+---------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 +----++---------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 -+---++---------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 --+--++---------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 ---+-++---------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 ----+++---------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 ++-----+--------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 +-+----+--------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 -++----+--------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 +--+---+--------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 -+-+---+--------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 --++---+--------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 +---+--+--------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 -+--+--+--------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 --+-+--+--------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 ---++--+--------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 +----+-+--------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
phase:+1
a:+1 -+---+-+--------------------------------------------------------
b:+1 -+++------------------------------------------------------------
;
...|]

Function to generate all intermediate external determinants $|\alpha \rangle$ between $|I\rangle$ and $|J\rangle$, with a positive phase factor.

  • exc is the degree of excitation between $|I\rangle$ and $|J\rangle$
  • cabs is the number of electrons in the CABS
  • l is the degree of excitation between $|I\rangle$ and $|\alpha \rangle$
  • r is the degree of excitation between $|\alpha \rangle$ and $|J\rangle$
In [84]:
let generate_alphas ki kj exc =
  (* Check input excitation degree *)
  let d = Determinant.degree ki kj in
  if d <> exc then
    Printf.sprintf "Invalid excitation degree. Expected %d and found %d." exc d
    |> failwith;
    
  (* Generate single excitations *)
  let all_singles ki =
      let mos_a, mos_b = Determinant.to_lists ki in
      [ List.map (fun hole -> 
          List.map (fun particle ->
               if hole = particle then None else
                  Some (Determinant.single_excitation Spin.Alfa hole particle ki)
              ) mos_abs
          ) mos_a
      ;
        List.map (fun hole -> 
          List.map (fun particle ->
               if hole = particle then None else
                 Some (Determinant.single_excitation Spin.Beta hole particle ki)
              ) mos_abs
          ) mos_b 
      ]
      |> List.concat
      |> List.concat
      |> Util.list_some
      |> List.filter (fun x -> Determinant.is_none x = false)
      |> List.map (fun x -> Determinant.set_phase Phase.Pos x)
  in
  
  (* Generate double excitations *)
  let all_doubles ki =
      let mos_a, mos_b = Determinant.to_lists ki in
      [ List.map (fun hole ->  (* Alpha-Alpha *)
          List.map (fun particle ->
            List.map (fun hole' -> 
              List.map (fun particle' ->
                if hole = particle || hole' = particle' then None else
                if hole' > hole && particle' < particle then
                  Some (Determinant.double_excitation Spin.Alfa hole particle Spin.Alfa hole' particle' ki)
                else None
                      ) mos_abs
                  ) mos_a 
              ) mos_abs
          ) mos_a
        ; 
        List.map (fun hole ->  (* Beta-Beta *)
          List.map (fun particle ->
            List.map (fun hole' -> 
              List.map (fun particle' ->
                if hole' > hole && particle' < particle && hole <> particle && hole' <> particle' then
                  Some (Determinant.double_excitation Spin.Beta hole particle Spin.Beta hole' particle' ki)
                else None
                      ) mos_abs
                  ) mos_b 
              ) mos_abs
          ) mos_b
        ;
        List.map (fun hole ->  (* Alpha-Beta *)
          List.map (fun particle ->
            List.map (fun hole' -> 
              List.map (fun particle' ->
                  if hole = particle || hole' = particle' then None else
                  Some (Determinant.double_excitation Spin.Alfa hole particle Spin.Beta hole' particle' ki)
                      ) mos_abs
                  ) mos_b 
              ) mos_abs
          ) mos_a
      ]
      |> List.concat
      |> List.concat
      |> List.concat
      |> List.concat
      |> Util.list_some
      |> List.filter (fun x -> Determinant.is_none x = false)
      |> List.map (fun x -> Determinant.set_phase Phase.Pos x)
  in

  (* Generate left and right excitations *)
  let al = List.concat [ all_singles ki ; all_doubles ki ] in
  let ar = List.concat [ all_singles kj ; all_doubles kj ] in
  
  let mo_class = DeterminantSpace.mo_class in_space in
  let m l =
    List.fold_left (fun accu i ->
        let j = i-1 in Bitstring.logor accu (Bitstring.shift_left_one mo_num j)
      ) (Bitstring.zero mo_num) l
  in
  let aux_mask = m (MOClass.auxiliary_mos mo_class) in
  let good_cabs k = 
      let alfa =
        Determinant.alfa k
        |> Spindeterminant.bitstring
      in
      let beta =
        Determinant.beta k
        |> Spindeterminant.bitstring
      in
      let a = Bitstring.logand aux_mask alfa
      and b = Bitstring.logand aux_mask beta
      in
      match Bitstring.popcount a + Bitstring.popcount b with
      | 1 | 2 -> true
      | _ -> false
  in
  
  (* Merge lists in a set of unique determinants *)
  List.concat [ al; ar ]
  |> List.sort_uniq compare
  
  (* Filter out all determinants with incorrect numbers of electrons in the CABS *)
  |> List.filter good_cabs 
  
  
let compute_HaaF ki alphas kj =
   List.fold_left (fun accu alpha -> accu
      +. h_ij aux_basis ki alpha
      *. f_ij aux_basis alpha kj
    ) 0. alphas
Out[84]:
val generate_alphas :
  Determinant.t -> Determinant.t -> int -> Determinant.t list = <fun>
Out[84]:
val compute_HaaF :
  CIMatrixElement.De.t ->
  CIMatrixElement.De.t list -> CIMatrixElement.De.t -> float = <fun>
In [85]:
let check n integral_value exc =
  let cpudet, cpuint = ref 0., ref 0. in
  let det_list =
      match n with
        | 0 -> det_I
        | n -> Array.sub det_I 0 n
  in
  let result =
        Printf.printf "Checking ... \n%!";
        let percent = ref 0 in
        let task (i,ki) =
            (let p = (10 * (i+1))/(Array.length det_list) in
            if p <> !percent then
                ( percent := p ; Printf.printf " - %3d %%\n%!" (p*10) ));
            Array.mapi (fun j kj -> 
                if i > j || Determinant.degree ki kj <> exc then
                    (0,0,0.,0.)
                else
                  begin
                    let alphas = generate_alphas ki kj exc in
                    let det_value =
                      let t0 = Unix.gettimeofday () in
                      let result = compute_HaaF ki alphas kj in
                      cpudet := !cpudet +. Unix.gettimeofday () -. t0;
                      result
                    in
                    let int_value = 
                      let t0 = Unix.gettimeofday () in
                      let result = integral_value ki kj in
                      cpuint := !cpuint +. Unix.gettimeofday () -. t0;
                      result
                    in
(*   Printf.printf "%d %d %e %e\n%!" i j det_value int_value;  *)
                    (i,j,det_value,int_value)
                  end
            ) det_list
        in
        det_list
        |> Array.mapi (fun i ki -> (i,ki))
        |> Array.to_list
        |> Stream.of_list
        |> Farm.run ~f:task
        |> Util.stream_to_list
        |> Array.concat
  in
  let i,j,d,v = 
      let rec aux k imax jmax emax dmax vmax = 
        if k = -1 then
          imax, jmax, dmax, vmax
        else
          let i, j, d, v = result.(k) in
          let e = abs_float (d -. v) in
          if e >= emax then
            aux (k-1) i j e d v
          else
            aux (k-1) imax jmax emax dmax vmax
      in
      aux (Array.length result - 1) 0 0 0. 0. 0.
  in
  let error = abs_float (d -. v) in
  if error < epsilon_float then
  (*
      Printf.printf "OK: %e\n%!" error
      *)
      Printf.printf "OK: (%d, %d) | %e %e | %e  |  cpu : %f  %f\n%!" i j d v error !cpudet !cpuint
  else
      Printf.printf "Failed: (%d, %d) | %e %e | %e  |  cpu : %f %f\n%!" i j d v error !cpudet !cpuint

    
let sum l f = List.fold_left (fun accu i -> accu +. f i) 0. l
Out[85]:
val check :
  int ->
  (CIMatrixElement.De.t -> CIMatrixElement.De.t -> float) -> int -> unit =
  <fun>
Out[85]:
val sum : 'a list -> ('a -> float) -> float = <fun>
In [86]:
let array_3_init d1 d2 d3 f =
  let result = 
      Bigarray.(Array3.create Float64 fortran_layout) d1 d2 d3
  in
  for k=1 to d3 do
      for j=1 to d2 do
          for i=1 to d1 do
             result.{i,j,k} <- f i j k
          done
      done
  done;
  result


let array_4_init d1 d2 d3 d4 f =
  let result = 
      Bigarray.(Genarray.create Float64 fortran_layout) [| d1;d2;d3;d4 |]
  in
  for l=1 to d4 do
    for k=1 to d3 do
      for j=1 to d2 do
        for i=1 to d1 do
           result.{i,j,k,l} <- f i j k l
        done
      done
    done
  done;
  result


let array_5_init d1 d2 d3 d4 d5 f =
  let result = 
      Bigarray.(Genarray.create Float64 fortran_layout) [| d1;d2;d3;d4;d5 |]
  in
  for m=1 to d5 do
    for l=1 to d4 do
      for k=1 to d3 do
        for j=1 to d2 do
          for i=1 to d1 do
             result.{i,j,k,l,m} <- f i j k l m
          done
        done
      done
    done
  done;
  result

(* ----- *)
Out[86]:
val array_3_init :
  int ->
  int ->
  int ->
  (int -> int -> int -> float) ->
  (float, Bigarray.float64_elt, Bigarray.fortran_layout) Bigarray.Array3.t =
  <fun>
Out[86]:
val array_4_init :
  int ->
  int ->
  int ->
  int ->
  (int -> int -> int -> int -> float) ->
  (float, Bigarray.float64_elt, Bigarray.fortran_layout) Bigarray.Genarray.t =
  <fun>
Out[86]:
val array_5_init :
  int ->
  int ->
  int ->
  int ->
  int ->
  (int -> int -> int -> int -> int -> float) ->
  (float, Bigarray.float64_elt, Bigarray.fortran_layout) Bigarray.Genarray.t =
  <fun>

1. 0

$i,j$ : orbital indices of MOs occupied in $|I\rangle$.

$k$ : orbital indices of MOs unoccupied in $|I\rangle$.

$\sum_i \sum_a \left( \hat{T}_{i}^{a} \hat{T}_{a}^{i} + \sum_j \sum_k \hat{T}_{ij}^{ak} \hat{T}_{ak}^{ij} \right)$

\begin{align} \sum_{a} \sum_{i} \left( h_{ia} + \sum_{j} \langle i j || a j \rangle + \sum_{\bar{j}} \langle i \bar{j} | a \bar{j} \rangle \right) \left( f_{ai} + \sum_{j} \left[ a j || i j \right] + \sum_{\bar{j}} \left[ a \bar{j} | i \bar{j} \right] \right) + \\ \sum_{\bar{a}} \sum_{\bar{i}} \left( h_{ia} + \sum_{j} \langle \bar{i} j | \bar{a} j \rangle + \sum_{\bar{j}} \langle \bar{i} \bar{j} || \bar{a} \bar{j} \rangle \right) \left( f_{ai} + \sum_{j} \left[ \bar{a} j | \bar{i} j \right] + \sum_{\bar{j}} \left[ \bar{a} \bar{j} || \bar{i} \bar{j} \right] \right) +\\ \sum_{a} \sum_{k} \sum_{i} \sum_{j<i} \langle i j || a k \rangle \left[ a k || i j \right] + \sum_{a} \sum_{\bar{k}} \sum_{i} \sum_{\bar{j}} \langle i \bar{j} | a \bar{k} \rangle \left[ a \bar{k} | i \bar{j} \right] + \\ \sum_{\bar{a}} \sum_{k} \sum_{\bar{i}} \sum_{j} \langle \bar{i} j | \bar{a} k \rangle \left[ \bar{a} k | \bar{i} j \right] + \sum_{\bar{a}} \sum_{\bar{k}} \sum_{\bar{i}} \sum_{\bar{j}<\bar{i}} \langle \bar{i} \bar{j} || \bar{a} \bar{k} \rangle \left[ \bar{a} \bar{k} || \bar{i} \bar{j} \right] \end{align}
In [176]:
let m_0111_1H_1F = 
  Vec.init mo_num (fun i -> 
        sum mos_cabs (fun a ->
            h_one i a Spin.Alfa *. f_one a i Spin.Alfa ))

let m_0122_Haa = 
  array_3_init mo_num mo_num mo_num (fun i j k ->
      sum mos_cabs (fun a ->
        h_two i j a k Spin.Alfa Spin.Alfa *. f_two a k i j Spin.Alfa Spin.Alfa
        ) )
        
let m_0222_Haa = 
  Mat.init_cols mo_num mo_num (fun i j ->
      sum mos_cabs (fun a ->
          sum mos_cabs (fun b -> if b >= a then 0. else
            h_two i j a b Spin.Alfa Spin.Alfa *. f_two a b i j Spin.Alfa Spin.Alfa
          )
      ) +.
      sum mos_in (fun k -> m_0122_Haa.{i,j,k}) 
     )
    
let m_0111_1H_2Fa = 
  Mat.init_cols mo_num mo_num (fun i j ->
      sum mos_cabs (fun a ->
        h_one i a Spin.Alfa *. f_two a j i j Spin.Alfa Spin.Alfa +.
        h_two i j a j Spin.Alfa Spin.Alfa *. f_one a j Spin.Alfa
      ) +.
      if i < j then 0. else
          begin
              sum mos_cabs (fun a ->
                  sum mos_cabs (fun b -> if b >= a then 0. else
                    h_two i j a b Spin.Alfa Spin.Alfa *. f_two a b i j Spin.Alfa Spin.Alfa
                  )
              ) +.
              sum mos_in (fun k -> m_0122_Haa.{i,j,k}) 
          end
  )

    
let m_0122_Hab = 
  array_3_init mo_num mo_num mo_num (fun i j k ->
      sum mos_cabs (fun a ->
         h_two i j a k Spin.Alfa Spin.Beta *. f_two a k i j Spin.Alfa Spin.Beta
      ) )

let m_0111_1H_2Fb = 
  Mat.init_cols mo_num mo_num (fun i j ->
      sum mos_cabs (fun a ->
        h_one i a Spin.Alfa *. f_two a j i j Spin.Alfa Spin.Beta +. 
        h_two i j a j Spin.Alfa Spin.Beta *. f_one a j Spin.Alfa +.
        h_one j a Spin.Alfa *. f_two a i j i Spin.Alfa Spin.Beta +. 
        h_two j i a i Spin.Alfa Spin.Beta *. f_one a i Spin.Alfa
      ) +.
    sum mos_in (fun k -> m_0122_Hab.{i,j,k} +. m_0122_Hab.{j,i,k} ) +.
    sum mos_cabs (fun a ->
        sum mos_cabs (fun b ->
        h_two i j a b Spin.Alfa Spin.Beta *. f_two a b i j Spin.Alfa Spin.Beta
        )
      )
    )
  
let m_0111_2Hb_2Fb =
  array_3_init mo_num mo_num mo_num (fun i j k ->
    sum mos_cabs (fun a ->
      h_two k i a i Spin.Alfa Spin.Beta *.
      f_two a j k j Spin.Alfa Spin.Beta +.
      h_two i k a k Spin.Alfa Spin.Beta *.
      f_two a j i j Spin.Alfa Spin.Alfa 
    ) -. m_0122_Hab.{k,i,j}
  )
  
  (*
let m_0111_2Hb_1F = 
  Mat.init_cols mo_num mo_num (fun i j -> sum mos_cabs (fun a ->
    h_two i j a j Spin.Alfa Spin.Beta *. f_one a j Spin.Alfa ))
    *)
  

let m_0111_2Ha_2Fa =
  array_3_init mo_num mo_num mo_num (fun i j k ->
    sum mos_cabs (fun a ->
      h_two i j a j Spin.Alfa Spin.Alfa *.
      f_two a k i k Spin.Alfa Spin.Alfa 
    ) -. if i < j then 0. else m_0122_Haa.{i,j,k}
  )


let m_0111_2Ha_2Fb =
  array_3_init mo_num mo_num mo_num (fun i j k ->
    sum mos_cabs (fun a ->
      h_two i j a j Spin.Alfa Spin.Alfa *.
      f_two a k i k Spin.Alfa Spin.Beta 
    )
  )
Out[176]:
val m_0111_1H_1F : Lacaml.D.vec = R1 R2 R3     R7 R8 R9
                                   0  0  0 ...  0  0  0
Out[176]:
val m_0122_Haa :
  (float, Bigarray.float64_elt, Bigarray.fortran_layout) Bigarray.Array3.t =
  <abstr>
Out[176]:
val m_0222_Haa : Lacaml.D.mat =
  

            -- 1 --     -- 2 --     -- 3 --      -- 4 --      -- 5 --
        1             0 -0.00155999 -0.00466441 -0.000572849 -0.000277703
        2   -0.00155999           0  -0.0026547  -0.00188444  -0.00180488
        3   -0.00466441  -0.0026547           0   -0.0026701  -0.00249827
                    ...         ...         ...          ...          ...
        7   -0.00714682 -0.00236835 -0.00472999  -0.00322358  -0.00278404
        8     -0.017848 -0.00472607 -0.00553701  -0.00305449  -0.00230393
        9    -0.0181431 -0.00480564 -0.00570883  -0.00294446  -0.00305449
  

            -- 6 --     -- 7 --     -- 8 --     -- 9 --
        1    -0.0137564 -0.00714682   -0.017848  -0.0181431
        2   -0.00395582 -0.00236835 -0.00472607 -0.00480564
        3   -0.00305449 -0.00472999 -0.00553701 -0.00570883
                    ...         ...         ...         ...
        7   -0.00241904           0 -0.00392545 -0.00436499
        8   -0.00615931 -0.00392545           0 -0.00939239
        9   -0.00662802 -0.00436499 -0.00939239           0
  
Out[176]:
val m_0111_1H_2Fa : Lacaml.D.mat =
  

           -- 1 --     -- 2 --     -- 3 --     -- 4 --     -- 5 --
        1            0 4.14739E-05 0.000191942 5.82024E-05 3.17097E-05
        2   0.00285405           0  0.00130171 0.000700762 0.000516783
        3   0.00481032 0.000752365           0  0.00113769 0.000719119
                   ...         ...         ...         ...         ...
        7   -0.0038408 -0.00136643 -0.00343881  -0.0025597 -0.00227822
        8    0.0164153   0.0118157   0.0104308   0.0060925  0.00526224
        9    0.0169863   0.0119275    0.010345  0.00631198  0.00505779
  

            -- 6 --      -- 7 --     -- 8 --     -- 9 --
        1   0.000201052 -1.30724E-06 0.000334792 0.000361285
        2   0.000232155  -0.00168232 0.000833107  0.00101709
        3   -0.00387499  0.000450358  0.00302133   0.0034399
                    ...          ...         ...         ...
        7   -0.00166305            0  0.00138329  0.00154135
        8    0.00316905    0.0028755           0     0.01773
        9    0.00269782   0.00232345  0.00673086           0
  
Out[176]:
val m_0122_Hab :
  (float, Bigarray.float64_elt, Bigarray.fortran_layout) Bigarray.Array3.t =
  <abstr>
Out[176]:
val m_0111_1H_2Fb : Lacaml.D.mat =
  

            -- 1 --     -- 2 --     -- 3 --     -- 4 --      -- 5 --
        1    0.00296582  0.00298846  0.00488803 0.000118834 -0.000472337
        2    0.00298846 -0.00136004 -0.00413128  -0.0063196  -0.00598211
        3    0.00488803 -0.00413128 -0.00712705 -0.00508588  -0.00503032
                    ...         ...         ...         ...          ...
        7   -0.00407176 -0.00213095 -0.00406698 -0.00417531  -0.00370236
        8     0.0160286   0.0113907   0.0122954  0.00422566   0.00433287
        9     0.0166197   0.0110532   0.0122399  0.00511697   0.00234682
  

           -- 6 --     -- 7 --    -- 8 --    -- 9 --
        1    0.0112594 -0.00407176  0.0160286  0.0166197
        2   0.00920237 -0.00213095  0.0113907  0.0110532
        3   0.00825188 -0.00406698  0.0122954  0.0122399
                   ...         ...        ...        ...
        7   0.00439536 -0.00205646 0.00450369 0.00403074
        8     0.015059  0.00450369   0.019825  0.0230216
        9    0.0158987  0.00403074  0.0230216    0.02206
  
Out[176]:
val m_0111_2Hb_2Fb :
  (float, Bigarray.float64_elt, Bigarray.fortran_layout) Bigarray.Array3.t =
  <abstr>
Out[176]:
val m_0111_2Ha_2Fa :
  (float, Bigarray.float64_elt, Bigarray.fortran_layout) Bigarray.Array3.t =
  <abstr>
Out[176]:
val m_0111_2Ha_2Fb :
  (float, Bigarray.float64_elt, Bigarray.fortran_layout) Bigarray.Array3.t =
  <abstr>
In [177]:
let integral_value ki kj = 

   let mos_i, mos_i' = mos_a ki, mos_b ki in
   let same = (mos_i = mos_i') in
   
   (* Alpha *)
   let a = 
       sum mos_i  (fun i -> m_0111_1H_1F.{i}) 
   in
   
   let b = 
       if same then a else
       sum mos_i' (fun i -> m_0111_1H_1F.{i})
   in
   
   let aa = 
       sum mos_i (fun j ->
         sum mos_i (fun i -> m_0111_1H_2Fa.{i,j} ))
   in
   
   let bb = 
     if same then aa else
     sum mos_i' (fun j ->
       sum mos_i' (fun i -> m_0111_1H_2Fa.{i,j} ))
   in
   
   let ab = 
     sum mos_i' (fun j ->
       sum mos_i (fun i -> m_0111_1H_2Fb.{i,j}  )) 
   in
   
   let aaa = 
       sum mos_i (fun k ->
         sum mos_i (fun j ->
           sum mos_i (fun i -> m_0111_2Ha_2Fa.{i,j,k} ))) 
   in
   
   let bbb = 
     if same then aaa else
       sum mos_i' (fun k ->
         sum mos_i' (fun j ->
           sum mos_i' (fun i -> m_0111_2Ha_2Fa.{i,j,k} )))
   in
   
   let baa = 
       sum mos_i' (fun k ->
         sum mos_i (fun j ->
           sum mos_i (fun i ->
             m_0111_2Ha_2Fb.{i,j,k} +. m_0111_2Hb_2Fb.{i,j,k}
       )))
   in
   
   let bba = 
       sum mos_i  (fun k ->
         sum mos_i' (fun j ->
           sum mos_i' (fun i ->
             m_0111_2Ha_2Fb.{i,j,k} +. m_0111_2Hb_2Fb.{j,i,k} 
       ))) 
   in

   a +. b +. aa +. bb +. ab +. aaa +. baa +. bba +. bbb
   
     
let _ =
  check 100 integral_value 0
Out[177]:
val integral_value : Determinant.t -> 'a -> float = <fun>
Checking ... 
 -  10 %
 -  20 %
 -  30 %
 -  40 %
 -  50 %
 -  60 %
 -  70 %
 -  80 %
 -  90 %
 - 100 %
Failed: (66, 66) | -1.636584e-01 -1.636584e-01 | 3.885781e-16  |  cpu : 4.423033 0.001962
Out[177]:
- : unit = ()

2. 1

In [89]:
let m_1111_1H_1F = 
  Mat.init_cols mo_num mo_num (fun i k -> 
        sum mos_cabs (fun a -> h_one i a Spin.Alfa *. f_one a k Spin.Alfa ))


let m_1111_1H_2Fa = 
  array_3_init mo_num mo_num mo_num (fun i j k ->
      sum mos_cabs (fun a ->
        h_one i a Spin.Alfa *. f_two a j k j Spin.Alfa Spin.Alfa ))

    
let m_1111_1H_2Fb = 
  array_3_init mo_num mo_num mo_num (fun i j k ->
      sum mos_cabs (fun a ->
        h_one i a Spin.Alfa *. f_two a j k j Spin.Alfa Spin.Beta ))


let m_1111_2Ha_1F = 
  array_3_init mo_num mo_num mo_num (fun i j k ->
   sum mos_cabs (fun a ->
    h_two i j a j Spin.Alfa Spin.Alfa *. f_one a k Spin.Alfa ))

    
let m_1111_2Hb_1F = 
  array_3_init mo_num mo_num mo_num (fun i j k ->
   sum mos_cabs (fun a ->
    h_two i j a j Spin.Alfa Spin.Beta *. f_one a k Spin.Alfa ))


let m_1111_2Ha_2Fa =
  array_4_init mo_num mo_num mo_num mo_num (fun i j k l ->
    sum mos_cabs (fun a ->
      h_two i j a j Spin.Alfa Spin.Alfa *.
      f_two a l k l Spin.Alfa Spin.Alfa 
    )
  )


let m_1111_2Hb_2Fa =
  array_4_init mo_num mo_num mo_num mo_num (fun i j k l ->
    sum mos_cabs (fun a ->
      h_two i j a j Spin.Alfa Spin.Beta *.
      f_two a l k l Spin.Alfa Spin.Alfa 
    )
  )


let m_1111_2Ha_2Fb =
  array_4_init mo_num mo_num mo_num mo_num (fun i j k l ->
    sum mos_cabs (fun a ->
      h_two i j a j Spin.Alfa Spin.Alfa *.
      f_two a l k l Spin.Alfa Spin.Beta 
    )
  )


let m_1111_2Hb_2Fb =
  array_4_init mo_num mo_num mo_num mo_num (fun i j k l ->
    sum mos_cabs (fun a ->
      h_two i j a j Spin.Alfa Spin.Beta *.
      f_two a l k l Spin.Alfa Spin.Beta 
    )
  )


let m_1112_1H_2Fa = 
  array_3_init mo_num mo_num mo_num (fun i j k ->
      sum mos_cabs (fun a ->
        h_one j a Spin.Alfa *. f_two a i j k Spin.Alfa Spin.Alfa ))

    
let m_1112_1H_2Fb = 
  array_3_init mo_num mo_num mo_num (fun i j k ->
      sum mos_cabs (fun a ->
        h_one j a Spin.Beta *. f_two a i j k Spin.Alfa Spin.Beta ))


let m_1112_2Ha_2Fa =
  array_4_init mo_num mo_num mo_num mo_num (fun i j k m ->
    sum mos_cabs (fun a ->
      h_two j m a m Spin.Alfa Spin.Alfa *.
      f_two a i j k Spin.Alfa Spin.Alfa 
    )
  )


let m_1112_2Hb_2Fa =
  array_4_init mo_num mo_num mo_num mo_num (fun i j k m ->
    sum mos_cabs (fun a ->
      h_two j m a m Spin.Alfa Spin.Beta *.
      f_two a i j k Spin.Alfa Spin.Alfa 
    )
  )

let m_1112_2Ha_2Fb =
  array_4_init mo_num mo_num mo_num mo_num (fun i j k m ->
    sum mos_cabs (fun a ->
      h_two j m a m Spin.Alfa Spin.Alfa *.
      f_two a i j k Spin.Alfa Spin.Beta 
    )
  )


let m_1112_2Hb_2Fb =
  array_4_init mo_num mo_num mo_num mo_num (fun i j k m ->
    sum mos_cabs (fun a ->
      h_two j m a m Spin.Alfa Spin.Beta *.
      f_two a i j k Spin.Alfa Spin.Beta 
    )
  )



let m_1121_2Ha_1F = 
  array_3_init mo_num mo_num mo_num (fun i j k ->
      sum mos_cabs (fun a ->
        h_two i j k a Spin.Alfa Spin.Alfa *. f_one a j Spin.Alfa))

    
let m_1121_2Hb_1F = 
  array_3_init mo_num mo_num mo_num (fun i j k ->
      sum mos_cabs (fun a ->
        h_two i j k a Spin.Alfa Spin.Beta *. f_one a j Spin.Beta))


let m_1121_2Ha_2Fa =
  array_4_init mo_num mo_num mo_num mo_num (fun i j k m ->
    sum mos_cabs (fun a ->
      h_two i j k a Spin.Alfa Spin.Alfa *.
      f_two m a m j Spin.Alfa Spin.Alfa 
    )
  )


let m_1121_2Hb_2Fa =
  array_4_init mo_num mo_num mo_num mo_num (fun i j k m ->
    sum mos_cabs (fun a ->
      h_two i j k a Spin.Alfa Spin.Beta *.
      f_two m a m j Spin.Alfa Spin.Alfa 
    )
  )

let m_1121_2Ha_2Fb =
  array_4_init mo_num mo_num mo_num mo_num (fun i j k m ->
    sum mos_cabs (fun a ->
      h_two i j k a Spin.Alfa Spin.Alfa *.
      f_two m a m j Spin.Alfa Spin.Beta 
    )
  )


let m_1121_2Hb_2Fb =
  array_4_init mo_num mo_num mo_num mo_num (fun i j k m ->
    sum mos_cabs (fun a ->
      h_two i j k a Spin.Alfa Spin.Beta *.
      f_two m a m j Spin.Alfa Spin.Beta 
    )
  )


let m_1122_va =
  array_4_init mo_num mo_num mo_num mo_num (fun i j k m ->
    sum mos_cabs (fun a ->
      h_two j i a m Spin.Alfa Spin.Alfa *.
      f_two m a k j Spin.Alfa Spin.Alfa 
    )
  )

let m_1122_v2 =
  array_4_init mo_num mo_num mo_num mo_num (fun i j k m ->
    sum mos_cabs (fun a ->
      h_two i j m a Spin.Alfa Spin.Beta *.
      f_two m a k j Spin.Alfa Spin.Beta 
    )
  )

let m_1122_v3 =
  array_4_init mo_num mo_num mo_num mo_num (fun i j k m ->
    sum mos_cabs (fun a ->
      h_two i j a m Spin.Alfa Spin.Beta *.
      f_two a m k j Spin.Alfa Spin.Beta 
    )
  )

let m_1122_oa =
  array_4_init mo_num mo_num mo_num mo_num (fun i j k l ->
    sum mos_cabs (fun a ->
      h_two j l a k Spin.Alfa Spin.Alfa *.
      f_two i a l j Spin.Alfa Spin.Alfa 
    )
  )

let m_1122_o =
  array_4_init mo_num mo_num mo_num mo_num (fun i j k l ->
    sum mos_cabs (fun a ->
      h_two l j k a Spin.Alfa Spin.Beta *.
      f_two i a l j Spin.Alfa Spin.Beta 
    )
  )
  
(*----*)

let integral_value ki kj = 
    let i, k, s, phase =
          match Excitation.of_det ki kj with
          | Excitation.(Single (phase, { hole ; particle ; spin })) ->
            hole, particle, spin, phase
          | _ -> assert false
    in
    
    (* MOs unoccupied in both I and J *)
    let mos_virt_a, mos_virt_b = 
      Array.init mo_num (fun i -> Some (i+1)) , 
      Array.init mo_num (fun i -> Some (i+1)) 
    in
    List.iter (fun i -> mos_virt_a.(i-1) <- None) (mos_a ki);
    List.iter (fun i -> mos_virt_a.(i-1) <- None) (mos_a kj);
    List.iter (fun i -> mos_virt_b.(i-1) <- None) (mos_b ki);
    List.iter (fun i -> mos_virt_b.(i-1) <- None) (mos_b kj);
    
    let mos_virt_a, mos_virt_b = 
      Array.to_list mos_virt_a |> Util.list_some,
      Array.to_list mos_virt_b |> Util.list_some
    in
   
    let mos_virt, mos_virt' =
       match s with
       | Spin.Alfa -> mos_virt_a, mos_virt_b
       | Spin.Beta -> mos_virt_b, mos_virt_a
    in
   
    let mos_ij, mos_ij' =
      let alfa = 
        let i = Spindeterminant.bitstring @@ Determinant.alfa ki in
        let j = Spindeterminant.bitstring @@ Determinant.alfa kj in
        Bitstring.to_list (Bitstring.logand i j)
      in
      let beta  = 
        let i = Spindeterminant.bitstring @@ Determinant.beta ki in
        let j = Spindeterminant.bitstring @@ Determinant.beta kj in
        Bitstring.to_list (Bitstring.logand i j)
      in
      match s with
      | Spin.Alfa -> alfa, beta
      | Spin.Beta -> beta, alfa
    in
    
    let mos_i, mos_i' =
      match s with
      | Spin.Alfa -> mos_a ki, mos_b ki
      | Spin.Beta -> mos_b ki, mos_a ki
    in
   
    let mos_j, mos_j' =
      match s with
      | Spin.Alfa -> mos_a kj, mos_b kj
      | Spin.Beta -> mos_b kj, mos_a kj
    in
   
    let result = 
     m_1111_1H_1F.{i,k} +. 
     sum mos_i (fun j -> if j = i then 0. else
       m_1111_1H_2Fa.{i,j,k} +. m_1111_2Ha_1F.{i,j,k} +.
       sum mos_i  (fun l -> if l = i then 0. else m_1111_2Ha_2Fa.{i,j,k,l}) +.
       sum mos_i' (fun l -> m_1111_2Ha_2Fb.{i,j,k,l})) +.
     sum mos_i' (fun j ->
       m_1111_1H_2Fb.{i,j,k} +. m_1111_2Hb_1F.{i,j,k} +.
       sum mos_i  (fun l -> if l = i then 0. else m_1111_2Hb_2Fa.{i,j,k,l}) +.
       sum mos_i' (fun l -> m_1111_2Hb_2Fb.{i,j,k,l}))
    +.
     sum mos_ij (fun j -> 
       m_1112_1H_2Fa.{i,j,k} +. 
       m_1121_2Ha_1F.{i,j,k} +. 
       sum mos_i  (fun m -> m_1112_2Ha_2Fa.{i,j,k,m}) +.
       sum mos_i' (fun m -> m_1112_2Hb_2Fa.{i,j,k,m}) +.
       sum mos_j  (fun m -> m_1121_2Ha_2Fa.{i,j,k,m}) +.
       sum mos_j' (fun m -> m_1121_2Ha_2Fb.{i,j,k,m})) +.
     sum mos_ij' (fun j ->
       m_1112_1H_2Fb.{i,j,k} +. 
       m_1121_2Hb_1F.{i,j,k} +. 
       sum mos_i  (fun m -> m_1112_2Hb_2Fb.{i,j,k,m}) +.
       sum mos_i' (fun m -> m_1112_2Ha_2Fb.{i,j,k,m}) +.
       sum mos_j  (fun m -> m_1121_2Hb_2Fb.{i,j,k,m}) +.
       sum mos_j' (fun m -> m_1121_2Hb_2Fa.{i,j,k,m}))
    +.
     sum mos_ij    (fun j -> 
            sum mos_virt (fun m ->  m_1122_va.{i,j,k,m} )) +.
     sum mos_ij'   (fun j -> 
            sum mos_virt (fun m ->  m_1122_v2.{i,j,k,m} )   +.
            sum mos_virt' (fun m ->  m_1122_v3.{i,j,k,m} ))   -.
     sum mos_ij    (fun j -> 
            sum mos_ij    (fun l -> if l <= j then 0. else m_1122_oa.{i,j,k,l} )) -. 
     sum mos_ij'   (fun j -> 
            sum mos_ij    (fun l ->  m_1122_o.{i,j,k,l} )) 
    in
    match phase with
    | Phase.Pos -> result
    | Phase.Neg -> -. result
     

(*
let ki = det_I.(77)
let kj = det_I.(83)

let _ = integral_value ki kj
let _ = 
    let alphas =  generate_alphas ki kj 1 1
    in compute_HaaF ki alphas kj
*)

let _ = check 100 integral_value 1 1
Out[89]:
val m_1111_1H_1F : Lacaml.D.mat =
  

        -- 1 -- -- 2 -- -- 3 -- -- 4 -- -- 5 --
        1         0       0       0       0       0
        2         0       0       0       0       0
        3         0       0       0       0       0
                ...     ...     ...     ...     ...
        7         0       0       0       0       0
        8         0       0       0       0       0
        9         0       0       0       0       0
  

        -- 6 -- -- 7 -- -- 8 -- -- 9 --
        1         0       0       0       0
        2         0       0       0       0
        3         0       0       0       0
                ...     ...     ...     ...
        7         0       0       0       0
        8         0       0       0       0
        9         0       0       0       0
  
Out[89]:
val m_1111_1H_2Fa :
  (float, Bigarray.float64_elt, Bigarray.fortran_layout) Bigarray.Array3.t =
  <abstr>
Out[89]:
val m_1111_1H_2Fb :
  (float, Bigarray.float64_elt, Bigarray.fortran_layout) Bigarray.Array3.t =
  <abstr>
Out[89]:
val m_1111_2Ha_1F :
  (float, Bigarray.float64_elt, Bigarray.fortran_layout) Bigarray.Array3.t =
  <abstr>
Out[89]:
val m_1111_2Hb_1F :
  (float, Bigarray.float64_elt, Bigarray.fortran_layout) Bigarray.Array3.t =
  <abstr>
Out[89]:
val m_1111_2Ha_2Fa :
  (float, Bigarray.float64_elt, Bigarray.fortran_layout) Bigarray.Genarray.t =
  <abstr>
Out[89]:
val m_1111_2Hb_2Fa :
  (float, Bigarray.float64_elt, Bigarray.fortran_layout) Bigarray.Genarray.t =
  <abstr>
Out[89]:
val m_1111_2Ha_2Fb :
  (float, Bigarray.float64_elt, Bigarray.fortran_layout) Bigarray.Genarray.t =
  <abstr>
Out[89]:
val m_1111_2Hb_2Fb :
  (float, Bigarray.float64_elt, Bigarray.fortran_layout) Bigarray.Genarray.t =
  <abstr>
Out[89]:
val m_1112_1H_2Fa :
  (float, Bigarray.float64_elt, Bigarray.fortran_layout) Bigarray.Array3.t =
  <abstr>
Out[89]:
val m_1112_1H_2Fb :
  (float, Bigarray.float64_elt, Bigarray.fortran_layout) Bigarray.Array3.t =
  <abstr>
Out[89]:
val m_1112_2Ha_2Fa :
  (float, Bigarray.float64_elt, Bigarray.fortran_layout) Bigarray.Genarray.t =
  <abstr>
Out[89]:
val m_1112_2Hb_2Fa :
  (float, Bigarray.float64_elt, Bigarray.fortran_layout) Bigarray.Genarray.t =
  <abstr>
Out[89]:
val m_1112_2Ha_2Fb :
  (float, Bigarray.float64_elt, Bigarray.fortran_layout) Bigarray.Genarray.t =
  <abstr>
Out[89]:
val m_1112_2Hb_2Fb :
  (float, Bigarray.float64_elt, Bigarray.fortran_layout) Bigarray.Genarray.t =
  <abstr>
Out[89]:
val m_1121_2Ha_1F :
  (float, Bigarray.float64_elt, Bigarray.fortran_layout) Bigarray.Array3.t =
  <abstr>
Out[89]:
val m_1121_2Hb_1F :
  (float, Bigarray.float64_elt, Bigarray.fortran_layout) Bigarray.Array3.t =
  <abstr>
Out[89]:
val m_1121_2Ha_2Fa :
  (float, Bigarray.float64_elt, Bigarray.fortran_layout) Bigarray.Genarray.t =
  <abstr>
Out[89]:
val m_1121_2Hb_2Fa :
  (float, Bigarray.float64_elt, Bigarray.fortran_layout) Bigarray.Genarray.t =
  <abstr>
Out[89]:
val m_1121_2Ha_2Fb :
  (float, Bigarray.float64_elt, Bigarray.fortran_layout) Bigarray.Genarray.t =
  <abstr>
Out[89]:
val m_1121_2Hb_2Fb :
  (float, Bigarray.float64_elt, Bigarray.fortran_layout) Bigarray.Genarray.t =
  <abstr>
Out[89]:
val m_1122_va :
  (float, Bigarray.float64_elt, Bigarray.fortran_layout) Bigarray.Genarray.t =
  <abstr>
Out[89]:
val m_1122_v2 :
  (float, Bigarray.float64_elt, Bigarray.fortran_layout) Bigarray.Genarray.t =
  <abstr>
Out[89]:
val m_1122_v3 :
  (float, Bigarray.float64_elt, Bigarray.fortran_layout) Bigarray.Genarray.t =
  <abstr>
Out[89]:
val m_1122_oa :
  (float, Bigarray.float64_elt, Bigarray.fortran_layout) Bigarray.Genarray.t =
  <abstr>
Out[89]:
val m_1122_o :
  (float, Bigarray.float64_elt, Bigarray.fortran_layout) Bigarray.Genarray.t =
  <abstr>
Out[89]:
val integral_value : Determinant.t -> Determinant.t -> float = <fun>
File "[89]", line 311, characters 8-13:
Error: This function has type
         int ->
         (CIMatrixElement.De.t -> CIMatrixElement.De.t -> float) ->
         int -> unit
       It is applied to too many arguments; maybe you forgot a `;'.
 310: 
 311: let _ = check 100 integral_value 1 1

4. 1 2

$|J\rangle = \hat{T}_{i}^{k}|I\rangle$

$j$ : orbital indices of MOs occupied both in $|I\rangle$ and $|J\rangle$.

$\sum_{j} \sum_{a} \sum_{b} \hat{T}_{ij}^{ab} \hat{T}_{ab}^{kj} + \sum_{\bar{j}} \sum_{a} \sum_{\bar{b}} \hat{T}_{i\bar{j}}^{a\bar{b}} \hat{T}_{a\bar{b}}^{k\bar{j}} $

$$ \sum_{j} \sum_{b}\sum_{a<b} \langle i j || a b \rangle \left[ ab || kj \right] + \sum_{\bar{j}} \sum_{\bar{b}}\sum_{a} \langle i \bar{j} | a \bar{b} \rangle \left[ a \bar{b} | k \bar{j} \right] $$
In [142]:
let m_1222a =
  array_3_init mo_num mo_num mo_num (fun i j k ->
    sum mos_cabs (fun a ->
    sum mos_cabs (fun b -> if b > a then 0. else
      h_two i j a b Spin.Alfa Spin.Alfa *.
      f_two a b k j Spin.Alfa Spin.Alfa 
    )
    )
  )

let m_1222 =
  array_3_init mo_num mo_num mo_num (fun i j k ->
    sum mos_cabs (fun a ->
    sum mos_cabs (fun b ->
      h_two i j a b Spin.Alfa Spin.Beta *.
      f_two a b k j Spin.Alfa Spin.Beta 
    )
    )
  )
  

let integral_value ki kj = 
    let i, k, s, phase =
          match Excitation.of_det ki kj with
          | Excitation.(Single (phase, { hole ; particle ; spin })) ->
            hole, particle, spin, phase
          | _ -> assert false
    in
    
   (* MOs unoccupied in both I and J *)
    let mos_j, mos_j' =
      let alfa = 
        let i = Spindeterminant.bitstring @@ Determinant.alfa ki in
        let j = Spindeterminant.bitstring @@ Determinant.alfa kj in
        Bitstring.to_list (Bitstring.logand i j)
      in
      let beta  = 
        let i = Spindeterminant.bitstring @@ Determinant.beta ki in
        let j = Spindeterminant.bitstring @@ Determinant.beta kj in
        Bitstring.to_list (Bitstring.logand i j)
      in
      match s with
      | Spin.Alfa -> alfa, beta
      | Spin.Beta -> beta, alfa
    in

    let result = 
        sum mos_j    (fun j ->  m_1222a.{i,j,k} ) +.
        sum mos_j'   (fun j ->  m_1222.{i,j,k} )
    in
    match phase with
    | Phase.Pos -> result
    | Phase.Neg -> -. result
     

let _ = check 100 integral_value 1 2
Out[142]:
val m_1222a :
  (float, Bigarray.float64_elt, Bigarray.fortran_layout) Bigarray.Array3.t =
  <abstr>
Out[142]:
val m_1222 :
  (float, Bigarray.float64_elt, Bigarray.fortran_layout) Bigarray.Array3.t =
  <abstr>
Out[142]:
val integral_value : Determinant.t -> Determinant.t -> float = <fun>
File "[142]", line 56, characters 8-13:
Error: This function has type
         int ->
         (CIMatrixElement.De.t -> CIMatrixElement.De.t -> float) ->
         int -> unit
       It is applied to too many arguments; maybe you forgot a `;'.
  55: 
  56: let _ = check 100 integral_value 1 2

5. 2 1

$|J\rangle = \hat{T}_{ij}^{kl}|I\rangle$

$m$ : orbital indices of MOs unoccupied both in $|I\rangle$ and $|J\rangle$.

$n$ : orbital indices of MOs occupied in $|I\rangle$

$\sum_{a} \hat{T}_{i}^{a} \hat{T}_{aj}^{kl} + \hat{T}_{j}^{a} \hat{T}_{ia}^{kl} $

$$ \sum_{a} \left( h_{ia} + \sum_{n} \langle i n || a n \rangle + \sum_{\bar{n}} \langle i \bar{n} | a \bar{n} \rangle \right) \left[ a j || k l \right] + \\ \sum_{a} \left( h_{ja} + \sum_{n} \langle j n || a n \rangle + \sum_{\bar{n}} \langle j \bar{n} | a \bar{n} \rangle \right) \left[ i a || k l \right] $$

$|J\rangle = \hat{T}_{ij}^{kl}|I\rangle$

$m$ : orbital indices of MOs unoccupied both in $|I\rangle$ and $|J\rangle$.

$n$ : orbital indices of MOs occupied in $|J\rangle$

$\sum_{a} \hat{T}_{ij}^{al} \hat{T}_{a}^{k} + \hat{T}_{ij}^{ka} \hat{T}_{a}^{l} + \hat{T}_{i\bar{j}}^{a\bar{l}} \hat{T}_{a}^{k} + \hat{T}_{i\bar{j}}^{k\bar{a}} \hat{T}_{\bar{a}}^{\bar{l}} $

$$ \sum_{a} \langle i j || a l \rangle \left( f_{ak} + \sum_{n} \left[ a n || k n \right] + \sum_{\bar{n}} \left[ a \bar{n} | k \bar{n} \right] \right) + \\ \sum_{a} \langle i j || k a \rangle \left( f_{al} + \sum_{n} \left[ n a || n l \right] + \sum_{\bar{n}} \left[ \bar{n} a | \bar{n} l \right] \right) $$

$|J\rangle = \hat{T}_{ij}^{kl}|I\rangle$

$m$ : orbital indices of MOs unoccupied both in $|I\rangle$ and $|J\rangle$.

$n$ : orbital indices of MOs occupied in both $|I\rangle$ and $|J\rangle$ .

$\sum_{a} \hat{T}_{ij}^{am} \hat{T}_{am}^{kl} + \hat{T}_{ij}^{ma} \hat{T}_{ma}^{kl} - \hat{T}_{in}^{al} \hat{T}_{aj}^{kn} - \hat{T}_{nj}^{ka} \hat{T}_{ia}^{nl} + \sum_{n} \hat{T}_{i\bar{n}}^{k\bar{a}} \hat{T}_{\bar{a}j}^{\bar{n}l} $

$$ \sum_{a} \sum_{m} \langle i j || a m \rangle \left[ a m || k l \right] + \langle i j || m a \rangle \left[ m a || k l \right] - \\ \sum_{n} \langle i n || a l \rangle \left[ a j || k n \right] + \langle n j || k a \rangle \left[ i a || n l \right] $$
In [ ]:
let m_2112_1H_2Fa =
  array_4_init mo_num mo_num mo_num mo_num (fun i j k l ->
    sum mos_cabs (fun a ->
        h_one i a Spin.Alfa *. f_two a j k l Spin.Alfa Spin.Alfa +.
        h_one j a Spin.Alfa *. f_two i a k l Spin.Alfa Spin.Alfa )
    )

let m_2112_1H_2Fb =
  array_4_init mo_num mo_num mo_num mo_num (fun i j k l ->
    sum mos_cabs (fun a ->
        h_one i a Spin.Alfa *. f_two a j k l Spin.Alfa Spin.Beta +.
        h_one j a Spin.Alfa *. f_two i a k l Spin.Alfa Spin.Beta)
    )

let m_2112_2Ha_2Fa =
  array_5_init mo_num mo_num mo_num mo_num mo_num (fun i j k l n ->
    sum mos_cabs (fun a ->
        h_two i n a n Spin.Alfa Spin.Alfa *.
        f_two a j k l Spin.Alfa Spin.Alfa )
    )
    
let m_2112_2Hb_2Fa =
  array_5_init mo_num mo_num mo_num mo_num mo_num (fun i j k l n ->
    sum mos_cabs (fun a ->
        h_two i n a n Spin.Alfa Spin.Beta *.
        f_two a j k l Spin.Alfa Spin.Alfa )
    )
    
let m_2112_2Ha_2Fb =
  array_5_init mo_num mo_num mo_num mo_num mo_num (fun i j k l n ->
    sum mos_cabs (fun a ->
        h_two i n a n Spin.Alfa Spin.Alfa *.
        f_two a j k l Spin.Alfa Spin.Beta )
    )
    
let m_2112_2Hb_2Fb =
  array_5_init mo_num mo_num mo_num mo_num mo_num (fun i j k l n ->
    sum mos_cabs (fun a ->
        h_two i n a n Spin.Alfa Spin.Beta *.
        f_two a j k l Spin.Alfa Spin.Beta )
    )
    

let m_2121_2Ha_1F =
  array_4_init mo_num mo_num mo_num mo_num (fun i j k l ->
    sum mos_cabs (fun a ->
        h_two i j a l Spin.Alfa Spin.Alfa *. f_one a k Spin.Alfa +.
        h_two i j k a Spin.Alfa Spin.Alfa *. f_one a l Spin.Alfa)
    )

let m_2121_2Hb_1F =
  array_4_init mo_num mo_num mo_num mo_num (fun i j k l ->
    sum mos_cabs (fun a ->
        h_two i j a l Spin.Alfa Spin.Beta *. f_one a k Spin.Alfa +.
        h_two i j k a Spin.Alfa Spin.Beta *. f_one a l Spin.Alfa)
    )

let m_2121_2Ha_2Fa =
  array_5_init mo_num mo_num mo_num mo_num mo_num (fun i j k l n ->
    sum mos_cabs (fun a ->
        h_two i j a l Spin.Alfa Spin.Alfa *.
        f_two a n k n Spin.Alfa Spin.Alfa )
    )
    
let m_2121_2Hb_2Fa =
  array_5_init mo_num mo_num mo_num mo_num mo_num (fun i j k l n ->
    sum mos_cabs (fun a ->
        h_two i j a l Spin.Alfa Spin.Beta *.
        f_two a n k n Spin.Alfa Spin.Alfa )
    )
    
let m_2121_2Ha_2Fb =
  array_5_init mo_num mo_num mo_num mo_num mo_num (fun i j k l n ->
    sum mos_cabs (fun a ->
        h_two i j a l Spin.Alfa Spin.Alfa *.
        f_two a n k n Spin.Alfa Spin.Beta )
    )
    
let m_2121_2Hb_2Fb =
  array_5_init mo_num mo_num mo_num mo_num mo_num (fun i j k l n ->
    sum mos_cabs (fun a ->
        h_two i j a l Spin.Alfa Spin.Beta *.
        f_two a n k n Spin.Alfa Spin.Beta )
    )
In [83]:
let integral_value ki kj = 
    let i, j, k, l, s, s', phase =
          match Excitation.of_det ki kj with
          | Excitation.(Double (phase, { hole ; particle ; spin }, {hole=hole' ; particle=particle' ; spin=spin' })) ->
            hole, hole', particle, particle', spin, spin', phase
          | _ -> assert false
    in
    let mos_i, mos_i' =
       match s with
       | Spin.Alfa -> mos_a ki, mos_b ki
       | Spin.Beta -> mos_b ki, mos_a ki
    in
    
    let mos_j, mos_j' =
       match s with
       | Spin.Alfa -> mos_a kj, mos_b kj
       | Spin.Beta -> mos_b kj, mos_a kj
    in
    
    let mos_ij, mos_ij' =
      let alfa = 
        let i = Spindeterminant.bitstring @@ Determinant.alfa ki in
        let j = Spindeterminant.bitstring @@ Determinant.alfa kj in
        Bitstring.to_list (Bitstring.logand i j)
      in
      let beta  =  
        let i = Spindeterminant.bitstring @@ Determinant.beta ki in
        let j = Spindeterminant.bitstring @@ Determinant.beta kj in
        Bitstring.to_list (Bitstring.logand i j)
      in
      match s with
      | Spin.Alfa -> alfa, beta
      | Spin.Beta -> beta, alfa
    in

     
    let mos_virt_a, mos_virt_b = 
       Array.init mo_num (fun i -> Some (i+1)) , 
       Array.init mo_num (fun i -> Some (i+1)) 
    in
    List.iter (fun i -> mos_virt_a.(i-1) <- None) (mos_a ki);
    List.iter (fun i -> mos_virt_a.(i-1) <- None) (mos_a kj);
    List.iter (fun i -> mos_virt_b.(i-1) <- None) (mos_b ki);
    List.iter (fun i -> mos_virt_b.(i-1) <- None) (mos_b kj);

    let mos_virt_a, mos_virt_b = 
      Array.to_list mos_virt_a |> Util.list_some,
      Array.to_list mos_virt_b |> Util.list_some
    in
    
    let mos_virt, mos_virt' =
      match s with
      | Spin.Alfa -> mos_virt_a, mos_virt_b
      | Spin.Beta -> mos_virt_b, mos_virt_a
    in
        
   
     
     let result = 
       if s = s' then
         let s'' = Spin.other s in
         m_2112_1H_2Fa.{i,j,k,l} +. 
         sum mos_i  (fun n ->
             m_2112_2Ha_2Fa.{i,j,k,l,n} +. m_2112_2Ha_2Fa.{j,i,l,k,n}
         ) +.
         sum mos_i' (fun n ->
             m_2112_2Hb_2Fa.{i,j,k,l,n} +. m_2112_2Hb_2Fa.{j,i,l,k,n}
         ) +.
         m_2121_2Ha_1F.{i,j,k,l} +. 
         sum mos_j  (fun n ->
             m_2121_2Ha_2Fa.{i,j,k,l,n} +. m_2121_2Ha_2Fa.{j,i,l,k,n}
         ) +.
         sum mos_j' (fun n ->
             m_2121_2Ha_2Fb.{i,j,k,l,n} +. m_2121_2Ha_2Fb.{j,i,l,k,n}
         ) +.
         sum mos_cabs (fun a -> 
            sum mos_ij  (fun n ->
                 h_two i n a k s  s  *.  f_two j a n l s  s 
              +. h_two i n a l s  s  *.  f_two j a k n s  s 
              -. h_two j n a k s  s  *.  f_two i a n l s  s   
              -. h_two j n a l s  s  *.  f_two i a k n s  s
              )
            +. sum mos_virt (fun m ->
                -. h_two i j a m s  s  *.  f_two m a k l s  s )
            +. sum mos_ij' (fun n ->
                 h_two i n k a s  s'' *.  f_two j a l n s  s''
              +. h_two j n l a s  s'' *.  f_two i a k n s  s''
              -. h_two i n l a s  s'' *.  f_two j a k n s  s''
              -. h_two j n k a s  s'' *.  f_two i a l n s  s''
              )
         )
       else
         m_2112_1H_2Fb.{i,j,k,l} +.
         sum mos_i  (fun n ->
             m_2112_2Ha_2Fb.{i,j,k,l,n} +. m_2112_2Hb_2Fb.{j,i,l,k,n}
         ) +.
         sum mos_i' (fun n ->
             m_2112_2Hb_2Fb.{i,j,k,l,n} +. m_2112_2Ha_2Fb.{j,i,l,k,n}
         ) +.
         m_2121_2Hb_1F.{i,j,k,l} +.
         sum mos_j  (fun n ->
             m_2121_2Hb_2Fa.{i,j,k,l,n} +. m_2121_2Hb_2Fb.{j,i,l,k,n}
         ) +.
         sum mos_j' (fun n ->
             m_2121_2Hb_2Fb.{i,j,k,l,n} +. m_2121_2Hb_2Fa.{j,i,l,k,n}
         ) +.
        sum mos_cabs (fun a ->
            sum mos_virt' (fun m ->
                  h_two i j a m s  s' *.  f_two a m k l s  s' ) +.
            sum mos_virt  (fun m ->
                  h_two i j m a s  s' *.  f_two m a k l s  s' ) +.
            sum mos_ij  (fun n ->
                  h_two n i a k s  s  *.  f_two a j n l s  s'
               +. h_two n j a l s  s' *.  f_two i a k n s  s 
               -. h_two n j k a s  s' *.  f_two i a n l s  s'
               ) +.
            sum mos_ij' (fun n -> if n >= j then 0. else 
                  h_two i n k a s  s' *.  f_two j a l n s' s'
               +. h_two n j a l s' s' *.  f_two i a k n s  s' ) +. 
            sum mos_ij' (fun n -> if n <= j then 0. else 
               -. h_two i n k a s  s' *.  f_two j a n l s' s' 
               -. h_two j n a l s' s' *.  f_two i a k n s  s' ) +.
            sum mos_ij' (fun n -> 
               -. h_two i n a l s  s' *.  f_two a j k n s  s'
               )
        )
     in

    match phase with
    | Phase.Pos -> result
    | Phase.Neg -> -. result
     

let _ = check 100  integral_value 2 1 
(*

let ki = det_I.(2)
let kj = det_I.(33)

let _ = integral_value ki kj
let _ = 
    let alphas =  generate_alphas ki kj 2 1
    in compute_HaaF ki alphas kj
*)
Out[83]:
val integral_value : Determinant.t -> Determinant.t -> float = <fun>
Checking ... 
 -  10 %
 -  20 %
 -  30 %
 -  40 %
 -  50 %
 -  60 %
 -  70 %
 -  80 %
 -  90 %
 - 100 %
OK: (11, 20) | -6.303757e-03 -6.303757e-03 | 4.336809e-18  |  cpu : 15.777756  0.108934
Out[83]:
- : unit = ()

12. 2 2

In [ ]:
let _ = png_image "2_2_22.png"

$|J\rangle = \hat{T}_{ij}^{kl}|I\rangle$

$$ \sum_{b}\sum_{a<b} \langle i j || a b \rangle \left[ ab || kj \right] $$
In [ ]:
let integral_value ki kj = 
    let h, h', p, p', s, s', phase =
          match Excitation.of_det ki kj with
          | Excitation.(Double (phase,
              { hole=h ; particle=p ; spin=s },
              { hole=h'; particle=p'; spin=s'}) )  -> h, h', p, p', s, s', phase
          | _ -> assert false
    in

    let result = 
       if s <> s' then (* Alpha-Beta *)
           sum mos_cabs (fun b -> 
           sum mos_cabs (fun a -> 
               h_two h h' a b s s'  *. f_two a b p p' s s'
           )) 
       else (* Alpha-Alpha / Beta-Beta *)
           sum mos_cabs (fun b -> 
           sum mos_cabs (fun a ->  if b >= a then 0. else
               h_two h h' a b s s'  *. f_two a b p p' s s'
           )) 
    in
    match phase with
    | Phase.Pos -> result
    | Phase.Neg -> -. result
     

let _ = check 100 integral_value 2 2 2 2

4. 3

In [419]:
let integral_value ki kj = 
    let i, j, m, k, l, n, s1, s2, s3, phase =
          match Excitation.of_det ki kj with
          | Excitation.(Triple (phase,
              { hole=h1 ; particle=p1 ; spin=s1 },
              { hole=h2 ; particle=p2 ; spin=s2 },
              { hole=h3 ; particle=p3 ; spin=s3 }) )  -> h1, h2, h3, p1, p2, p3, s1, s2, s3, phase
          | _ -> assert false
    in

    let result = 
       let open Spin in 
       match s1, s2, s3 with
       | Alfa, Alfa, Alfa
       | Beta, Beta, Beta -> 
           sum mos_cabs (fun a -> 
                h_two i j a k s1 s2 *.  f_two m a l n s3 s3 
             +. h_two i j a n s1 s2 *.  f_two m a k l s3 s2 
             +. h_two i m a l s1 s3 *.  f_two j a k n s2 s3 
             +. h_two j m a k s2 s3 *.  f_two i a l n s1 s3 
             +. h_two j m a n s2 s3 *.  f_two i a k l s1 s2 
             -. h_two i j a l s1 s2 *.  f_two m a k n s3 s3 
             -. h_two i m a k s1 s3 *.  f_two j a l n s2 s3 
             -. h_two i m a n s1 s3 *.  f_two j a k l s2 s2 
             -. h_two j m a l s2 s3 *.  f_two i a k n s1 s3 )
       | Alfa, Alfa, Beta
       | Beta, Beta, Alfa -> 
           sum mos_cabs (fun a -> 
                h_two i j a l s1 s2 *.  f_two a m k n s1 s3
             +. h_two i m k a s1 s3 *.  f_two j a l n s2 s3
             +. h_two j m a n s2 s3 *.  f_two i a k l s1 s2 
             +. h_two j m l a s2 s3 *.  f_two i a k n s1 s3
             -. h_two i j a k s1 s2 *.  f_two a m l n s1 s3
             -. h_two i m a n s1 s3 *.  f_two j a k l s2 s2 
             -. h_two i m l a s1 s3 *.  f_two j a k n s2 s3
             -. h_two j m k a s2 s3 *.  f_two i a l n s1 s3
           ) 
       | Alfa, Beta, Beta
       | Beta, Alfa, Alfa -> 
           sum mos_cabs (fun a -> 
                h_two i j a l s1 s2 *.  f_two a m k n s1 s3 
             +. h_two i m a n s1 s3 *.  f_two a j k l s1 s2 
             +. h_two i m k a s1 s3 *.  f_two j a l n s2 s3 
             +. h_two j m a n s2 s3 *.  f_two i a k l s1 s2 
             -. h_two i j a n s1 s2 *.  f_two a m k l s1 s2 
             -. h_two i j k a s1 s2 *.  f_two m a l n s2 s3 
             -. h_two i m a l s1 s3 *.  f_two a j k n s1 s3 
             -. h_two j m a l s2 s3 *.  f_two i a k n s1 s3 
           ) 
       | Beta, Alfa, Beta
       | Alfa, Beta, Alfa ->  assert false (*TODO *)
    in
    match phase with
    | Phase.Pos -> result
    | Phase.Neg -> -. result
     

let _ = check 200 integral_value 3
Out[419]:
val integral_value : Determinant.t -> Determinant.t -> float = <fun>
Checking ... 
 -  10 %
 -  20 %
 -  30 %
 -  40 %
 -  50 %
 -  60 %
 -  70 %
 -  80 %
 -  90 %
 - 100 %
OK: (24, 43) | 1.154913e-03 1.154913e-03 | 6.505213e-19  |  cpu : 10.122233  0.688825
Out[419]:
- : unit = ()
In [ ]:
let ki = det_I.(129)
let kj = det_I.(349)

let alpha_to_string alpha = 
   
      let exc0 = Array.init (aux_num+1) (fun _ -> [|"-";"-"|]) in
 
      let i, j, m, k, l, n,  s, s', s'',  phase =
          match Excitation.of_det ki kj with
          | Excitation.(Triple (phase,
              { hole ; particle ; spin },
              {hole=hole' ; particle=particle' ; spin=spin' }, 
              {hole=hole''; particle=particle''; spin=spin''}  )) ->
            hole, hole', hole'', particle, particle', particle'', spin, spin', spin'', phase
          | _ -> assert false
      in
      let spin = function
        | Spin.Alfa -> 0
        | _ -> 1
      in
        exc0.(i).(spin s  ) <- "i" 
      ; exc0.(j).(spin s' ) <- "j" 
      ; exc0.(k).(spin s  ) <- "k" 
      ; exc0.(l).(spin s' ) <- "l" 
      ; exc0.(m).(spin s'') <- "m" 
      ; exc0.(n).(spin s'') <- "n" 
      ;
      let s0, s0', s0'' = s, s', s'' in
    
      let i, j, k, l, s, s', p1 =
          match Excitation.of_det ki alpha with
          | Excitation.(Double (phase, { hole ; particle ; spin }, {hole=hole' ; particle=particle' ; spin=spin' })) ->
            hole, hole', particle, particle', spin, spin', phase
          | _ -> assert false
      in
      
      if exc0.(i).(spin s ) =  "-" then exc0.(i).(spin s ) <- "p";
      if exc0.(j).(spin s') =  "-" then exc0.(j).(spin s') <- "p";
      if exc0.(k).(spin s ) =  "-" then exc0.(k).(spin s ) <- if k > mo_num then "a" else "q";
      if exc0.(l).(spin s') =  "-" then exc0.(l).(spin s') <- if l > mo_num then "a" else "q";
      
      let string_h = 
          Printf.sprintf "h_two %s %s %s %s %s %s *.  " 
            exc0.(i).(spin s )
            exc0.(j).(spin s')
            exc0.(k).(spin s )
            exc0.(l).(spin s')
            (if s  = s0  then "s " else if s = s0'  then "s'"  else "s''")
            (if s' = s0' then "s'" else if s = s0'' then "s''" else "s"  )
      in 
      
      let i, j, k, l, s, s', p2 =
          match Excitation.of_det alpha kj with
          | Excitation.(Double (phase, { hole ; particle ; spin }, {hole=hole' ; particle=particle' ; spin=spin' })) ->
            hole, hole', particle, particle', spin, spin', phase
          | _ -> assert false
      in
      
      let string_f = 
          Printf.sprintf "f_two %s %s %s %s %s %s" 
            exc0.(i).(spin s )
            exc0.(j).(spin s')
            exc0.(k).(spin s )
            exc0.(l).(spin s')
            (if s  = s0  then "s " else if s = s0'  then "s'"  else "s''")
            (if s' = s0' then "s'" else if s = s0'' then "s''" else "s"  )
      in
        (*
        Format.printf "|I> -> |a> : %a | %s\n@." Excitation.pp (Excitation.of_det ki alpha) string_h ;
        Format.printf "|a> -> |J> : %a | %s\n@." Excitation.pp (Excitation.of_det alpha kj) string_f ;
        *)

    
        let sign = 
            if Phase.add p1 p2 = phase then "+." else "-."
        in
        sign ^ string_h ^ string_f
    

let alpha_debug alpha = 
   
      let i, j, k, l, s, s', p1 =
          match Excitation.of_det ki alpha with
          | Excitation.(Double (phase, { hole ; particle ; spin }, {hole=hole' ; particle=particle' ; spin=spin' })) ->
            hole, hole', particle, particle', spin, spin', phase
          | _ -> assert false
      in
      Printf.printf "%d %d %d %d " i j k l;
      
      let i, j, k, l, s, s', p2 =
          match Excitation.of_det alpha kj with
          | Excitation.(Double (phase, { hole ; particle ; spin }, {hole=hole' ; particle=particle' ; spin=spin' })) ->
            hole, hole', particle, particle', spin, spin', phase
          | _ -> assert false
      in
      (*
        Format.printf "|I> -> |a> : %a | \n@." Excitation.pp (Excitation.of_det ki alpha) ;
        Format.printf "|a> -> |J> : %a | \n@." Excitation.pp (Excitation.of_det alpha kj) ;
        *)
      Printf.printf "%d %d %d %d \n%!" i j k l

      
let strings = 
    Format.printf "|I> -> |J> : %a |\n@." Excitation.pp (Excitation.of_det ki kj) ;
    generate_alphas ki kj 3 1 2 2
    |> Array.of_list
    |> Array.mapi (fun kk alpha -> alpha_to_string alpha)
    |> Array.to_list
    |> List.sort_uniq compare
    |> Array.of_list

let _ = Array.iteri (fun i x -> Printf.printf "%d %s \n%!" i x) strings

let _ =
  let v =
    let alphas =
      generate_alphas ki kj 3 1 2 2
      (*
      |> List.filter (fun alpha ->
        let x =  alpha_to_string alpha in
           x = strings.(6)
        )
        *)
    in
    (*
    List.iter alpha_debug alphas ;
    Printf.printf "\n%!";
    *)
    compute_HaaF ki alphas kj 
  in
  let x = (integral_value ki kj) in
  Printf.printf "%20.8e %20.8e %20.8e\n%!" x v (v-. x)
In [ ]:

</html>