-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExponentials.F90
More file actions
589 lines (540 loc) · 20.9 KB
/
Exponentials.F90
File metadata and controls
589 lines (540 loc) · 20.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
! MIT License
!
! Copyright (c) 2018-2021 Florian Goth
!
! Permission is hereby granted, free of charge, to any person obtaining a copy
! of this software and associated documentation files (the "Software"), to deal
! in the Software without restriction, including without limitation the rights
! to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
! copies of the Software, and to permit persons to whom the Software is
! furnished to do so, subject to the following conditions:
!
! The above copyright notice and this permission notice shall be included in
! all copies or substantial portions of the Software.
!
! THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
! OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
! FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
! THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
! LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
! FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
! DEALINGS IN THE SOFTWARE.
module Exponentials_mod
Use ZeroDiagSingleColExp_mod
Use HomogeneousSingleColExp_mod
Use TraceLessSingleColExp_mod
Use GeneralSingleColExp_mod
implicit none
!--------------------------------------------------------------------
!> @author
!> Florian Goth
!
!> @brief
!> A wrapper type such that Fortran can hold an array of
!> base class pointers.
!--------------------------------------------------------------------
type :: SingleColeExpBaseWrapper
class(SingleColExpBase), pointer :: dat => null()
end type
!--------------------------------------------------------------------
!> @author
!> Florian Goth
!
!> @brief
!> This holds together a set of exponentials that, if applied in the
!> correct order, approximate e^A to first order.
!> It provides functions for matrix-matrix and matrix-vector
!> multiplications in transposed and non-transposed manner.
!--------------------------------------------------------------------
type :: EulerExp
integer :: nrofcols ! The number of colors
Type(SingleColeExpBaseWrapper), allocatable :: singleexps(:) ! an array of pointers to the actual polymorphic classes that do the work
contains
procedure :: init => EulerExp_init
procedure :: dealloc => EulerExp_dealloc
procedure :: vecmult => EulerExp_vecmult
procedure :: vecmult_T => EulerExp_vecmult_T
procedure :: lmult => EulerExp_lmult
procedure :: lmultinv => EulerExp_lmultinv
procedure :: rmult => EulerExp_rmult
procedure :: rmultinv => EulerExp_rmultinv
procedure :: rmult_T => EulerExp_rmult_T
procedure :: lmult_T => EulerExp_lmult_T
procedure :: adjointaction => EulerExp_adjointaction
procedure :: adjoint_over_two => EulerExp_adjoint_over_two
procedure :: adjoint_over_two_T => EulerExp_adjoint_over_two_T
procedure :: rmultinv_T => EulerExp_rmultinv_T
procedure :: lmultinv_T => EulerExp_lmultinv_T
end type EulerExp
!--------------------------------------------------------------------
!> @author
!> Florian Goth
!
!> @brief
!> This holds together a set of Euler exponentials
!> and applies them in the correct order to obtain higher order
!> approximations.
!> Note that due to the use of higher-order approximations we have successive
!> Strang pairings. Hence the Euler type method needs to be treated separately.
!--------------------------------------------------------------------
type :: FullExp
integer :: method
integer :: evals
type(EulerExp), allocatable :: stages(:)
contains
procedure :: init => FullExp_init
procedure :: dealloc => FullExp_dealloc
procedure :: vecmult => FullExp_vecmult
procedure :: vecmult_T => FullExp_vecmult_T
procedure :: lmult => FullExp_lmult
procedure :: lmultinv => FullExp_lmultinv
procedure :: rmult => FullExp_rmult
procedure :: rmultinv => FullExp_rmultinv
procedure :: lmult_T => FullExp_lmult_T
procedure :: adjoint_over_two => FullExp_adjoint_over_two
end type FullExp
contains
subroutine FullExp_init(this, nodes, usedcolors, dcols, method, weight)
class(FullExp) :: this
type(node), dimension(:), intent(in) :: nodes
integer, intent(in) :: usedcolors, method
real(kind=kind(0.D0)), intent(in), allocatable, dimension(:, :) :: dcols
real (kind=kind(0.d0)), intent(in) :: weight
real (kind=kind(0.d0)) :: tmp
this%method = method
#ifndef NDEBUG
write(*,*) "Setting up Full Checkerboard exponential."
#endif
select case (method)
case (2)! Strang
this%evals = 2
allocate(this%stages(this%evals))
tmp = 1.D0/2.D0*weight
call this%stages(1)%init(nodes, usedcolors, dcols, tmp)
call this%stages(2)%init(nodes, usedcolors, dcols, tmp)
case (3)! SE_2 2, Blanes
this%evals = 4
allocate(this%stages(this%evals))
tmp = 0.21178*weight
call this%stages(1)%init(nodes, usedcolors, dcols, tmp)
tmp = 0.28822*weight
call this%stages(2)%init(nodes, usedcolors, dcols, tmp)
tmp = 0.28822*weight
call this%stages(3)%init(nodes, usedcolors, dcols, tmp)
tmp = 0.21178*weight
call this%stages(4)%init(nodes, usedcolors, dcols, tmp)
case (4)! S_3 4, Yoshida, Neri, Suzuki, 1990
this%evals = 6
allocate(this%stages(this%evals))
tmp = 0.6756035959798*weight
call this%stages(1)%init(nodes, usedcolors, dcols, tmp)
tmp = 0.6756035959798*weight
call this%stages(2)%init(nodes, usedcolors, dcols, tmp)
tmp = -0.8512071919597*weight
call this%stages(3)%init(nodes, usedcolors, dcols, tmp)
tmp = -0.8512071919597*weight
call this%stages(4)%init(nodes, usedcolors, dcols, tmp)
tmp = 0.6756035959798*weight
call this%stages(5)%init(nodes, usedcolors, dcols, tmp)
tmp = 0.6756035959798*weight
call this%stages(6)%init(nodes, usedcolors, dcols, tmp)
case (5)! SE_6 4, Blanes, Blanes and Moan 2002
this%evals = 12
allocate(this%stages(this%evals))
tmp = 0.079203696431195694249716154899943D0 *weight
call this%stages(1)%init(nodes, usedcolors, dcols, tmp)
tmp = 0.13031141018216631233261892930386D0 *weight
call this%stages(2)%init(nodes, usedcolors, dcols, tmp)
tmp = 0.22286149586760771457161212083520D0 *weight
call this%stages(3)%init(nodes, usedcolors, dcols, tmp)
tmp = -0.36671326904742572450057735977680D0 *weight
call this%stages(4)%init(nodes, usedcolors, dcols, tmp)
tmp = 0.32464818868970622689484883949262D0 *weight
call this%stages(5)%init(nodes, usedcolors, dcols, tmp)
tmp = 0.1096884778767497764517813152452D0 *weight
call this%stages(6)%init(nodes, usedcolors, dcols, tmp)
tmp = 0.1096884778767497764517813152452D0 *weight
call this%stages(7)%init(nodes, usedcolors, dcols, tmp)
tmp = 0.3246481886897062268948488394926D0 *weight
call this%stages(8)%init(nodes, usedcolors, dcols, tmp)
tmp = -0.3667132690474257245005773597768D0 *weight
call this%stages(9)%init(nodes, usedcolors, dcols, tmp)
tmp = 0.2228614958676077145716121208352D0 *weight
call this%stages(10)%init(nodes, usedcolors, dcols, tmp)
tmp = 0.1303114101821663123326189293039D0 *weight
call this%stages(11)%init(nodes, usedcolors, dcols, tmp)
tmp = 0.0792036964311956942497161548999D0 *weight
call this%stages(12)%init(nodes, usedcolors, dcols, tmp)
end select
end subroutine FullExp_init
subroutine FullExp_dealloc(this)
class(FullExp) :: this
integer :: i
do i = 1, this%evals
call this%stages(i)%dealloc()
enddo
deallocate(this%stages)
end subroutine FullExp_dealloc
!--------------------------------------------------------------------
!> @author
!> Florian Goth
!
!> @brief
!> This function multiplies this full exponential with a vector
!
!> @param[in] this The exponential opbject
!> @param[in] vec The vector that we multiply
!--------------------------------------------------------------------
subroutine FullExp_vecmult(this, vec)
class(FullExp) :: this
complex(kind=kind(0.D0)), dimension(:), intent(inout) :: vec
integer :: i
do i = 1, this%evals
call this%stages(i)%vecmult(vec)
enddo
end subroutine FullExp_vecmult
subroutine FullExp_vecmult_T(this, vec)
class(FullExp) :: this
complex(kind=kind(0.D0)), dimension(:), intent(inout) :: vec
integer :: i
do i = this%evals, 1, -1
call this%stages(i)%vecmult_T(vec)
enddo
end subroutine FullExp_vecmult_T
subroutine FullExp_lmult(this, mat)
class(FullExp) :: this
complex(kind=kind(0.D0)), intent(inout), contiguous :: mat(:,:)
integer :: i
do i = this%evals-1, 1, -2
call this%stages(i+1)%lmult_T(mat)
call this%stages(i)%lmult(mat)
enddo
end subroutine FullExp_lmult
subroutine FullExp_adjoint_over_two(this, mat)
class(FullExp) :: this
complex(kind=kind(0.D0)), intent(inout) :: mat(:,:)
integer :: i
do i = this%evals-1, 1, -2
call this%stages(i+1)%adjoint_over_two_T(mat)
call this%stages(i)%adjoint_over_two(mat)
enddo
end subroutine FullExp_adjoint_over_two
subroutine FullExp_lmultinv(this, mat)
class(FullExp) :: this
complex(kind=kind(0.D0)), intent(inout), contiguous :: mat(:,:)
integer :: i
do i = 1, this%evals, 2
call this%stages(i)%lmultinv(mat)
call this%stages(i+1)%lmultinv_T(mat)
enddo
end subroutine FullExp_lmultinv
subroutine FullExp_rmult(this, mat)
class(FullExp) :: this
complex(kind=kind(0.D0)), dimension(:, :), intent(inout) :: mat
integer :: i
do i = 1, this%evals,2
call this%stages(i)%rmult(mat)
call this%stages(i+1)%rmult_T(mat)
enddo
end subroutine FullExp_rmult
subroutine FullExp_rmultinv(this, mat)
class(FullExp) :: this
complex(kind=kind(0.D0)), intent(inout) :: mat(:,:)
integer :: i
do i = this%evals-1, 1, -2
call this%stages(i+1)%rmultinv_T(mat)
call this%stages(i)%rmultinv(mat)
enddo
end subroutine FullExp_rmultinv
subroutine FullExp_lmult_T(this, mat)
class(FullExp) :: this
complex(kind=kind(0.D0)), dimension(:, :), intent(inout) :: mat
integer :: i
do i = 1, this%evals, 2
call this%stages(i)%lmult_T(mat)
call this%stages(i+1)%lmult(mat)
enddo
end subroutine FullExp_lmult_T
subroutine EulerExp_dealloc(this)
class(EulerExp) :: this
integer :: i
do i = 1, this%nrofcols
call this%singleexps(i)%dat%dealloc()
deallocate(this%singleexps(i)%dat)
enddo
deallocate(this%singleexps)
end subroutine EulerExp_dealloc
!--------------------------------------------------------------------
!> @author
!> Florian Goth
!
!> @brief
!> This function multiplies this Euler exponential with a vector.
!
!> @param[in] this The exponential opbject
!> @param[in] vec The vector that we multiply
!--------------------------------------------------------------------
subroutine EulerExp_vecmult(this, vec)
class(EulerExp) :: this
complex(kind=kind(0.D0)), dimension(:) :: vec
integer :: i
do i = 1, this%nrofcols
call this%singleexps(i)%dat%vecmult(vec)
enddo
end subroutine EulerExp_vecmult
!--------------------------------------------------------------------
!> @author
!> Florian Goth
!
!> @brief
!> This function multiplies this transposed full exponential,
!> i.e reverses the order of application of exponentials, with a vector.
!
!> @param[in] this The exponential opbject
!> @param[in] vec The vector that we multiply
!--------------------------------------------------------------------
subroutine EulerExp_vecmult_T(this, vec)
class(EulerExp) :: this
complex(kind=kind(0.D0)), dimension(:) :: vec
integer :: i
do i = this%nrofcols, 1, -1
call this%singleexps(i)%dat%vecmult(vec)
enddo
end subroutine EulerExp_vecmult_T
subroutine EulerExp_lmultinv(this, mat)
class(EulerExp) :: this
complex(kind=kind(0.D0)), dimension(:, :), contiguous :: mat
integer :: i
do i = 1, this%nrofcols
call this%singleexps(i)%dat%lmultinv(mat)
enddo
end subroutine EulerExp_lmultinv
subroutine EulerExp_lmult(this, mat)
class(EulerExp) :: this
complex(kind=kind(0.D0)), dimension(:, :), contiguous :: mat
integer :: i
do i = this%nrofcols, 1, -1
call this%singleexps(i)%dat%lmult(mat)
enddo
end subroutine EulerExp_lmult
subroutine EulerExp_adjointaction(this, mat)
class(EulerExp) :: this
complex(kind=kind(0.D0)), dimension(:, :) :: mat
integer :: i
do i = this%nrofcols, 1, -1
call this%singleexps(i)%dat%adjointaction(mat)
enddo
end subroutine EulerExp_adjointaction
subroutine EulerExp_adjoint_over_two(this, mat)
class(EulerExp) :: this
complex(kind=kind(0.D0)), dimension(:, :) :: mat
integer :: i
do i = this%nrofcols, 1, -1
call this%singleexps(i)%dat%adjoint_over_two(mat)
enddo
end subroutine EulerExp_adjoint_over_two
subroutine EulerExp_adjoint_over_two_T(this, mat)
class(EulerExp) :: this
complex(kind=kind(0.D0)), dimension(:, :) :: mat
integer :: i
do i = 1, this%nrofcols
call this%singleexps(i)%dat%adjoint_over_two(mat)
enddo
end subroutine EulerExp_adjoint_over_two_T
subroutine EulerExp_rmult(this, mat)
class(EulerExp) :: this
complex(kind=kind(0.D0)), dimension(:, :) :: mat
integer :: i
do i = 1, this%nrofcols
call this%singleexps(i)%dat%rmult(mat)
enddo
end subroutine EulerExp_rmult
subroutine EulerExp_rmultinv(this, mat)
class(EulerExp) :: this
complex(kind=kind(0.D0)), dimension(:, :) :: mat
integer :: i
do i = this%nrofcols, 1, -1
call this%singleexps(i)%dat%rmultinv(mat)
enddo
end subroutine EulerExp_rmultinv
subroutine EulerExp_rmult_T(this, mat)
class(EulerExp) :: this
complex(kind=kind(0.D0)), dimension(:, :) :: mat
integer :: i
do i = this%nrofcols, 1, -1
call this%singleexps(i)%dat%rmult(mat)
enddo
end subroutine EulerExp_rmult_T
subroutine EulerExp_rmultinv_T(this, mat)
class(EulerExp) :: this
complex(kind=kind(0.D0)), dimension(:, :) :: mat
integer :: i
do i = 1, this%nrofcols
call this%singleexps(i)%dat%rmultinv(mat)
enddo
end subroutine EulerExp_rmultinv_T
subroutine EulerExp_lmult_T(this, mat)
class(EulerExp) :: this
complex(kind=kind(0.D0)), dimension(:, :) :: mat
integer :: i
do i = 1, this%nrofcols
call this%singleexps(i)%dat%lmult(mat)
enddo
end subroutine EulerExp_lmult_T
subroutine EulerExp_lmultinv_T(this, mat)
class(EulerExp) :: this
complex(kind=kind(0.D0)), dimension(:, :) :: mat
integer :: i
do i = this%nrofcols, 1, -1
call this%singleexps(i)%dat%lmultinv(mat)
enddo
end subroutine EulerExp_lmultinv_T
!--------------------------------------------------------------------
!> @author
!> Florian Goth
!
!> @brief
!> A function to determine the equality of two floating point numbers.
!> @param[in] a first number
!> @param[in] b second number
!> @return true if the numbers are equal up to 10^-15 of relative deviation.
!--------------------------------------------------------------------
function fpequal(a, b) result(isequal)
real(kind=kind(0.D0)), intent(in) :: a, b
logical :: isequal
isequal = .true.
if(abs(a - b) > max(abs(a), abs(b)) * 1E-15) then
isequal = .false.
endif
end function
!--------------------------------------------------------------------
!> @author
!> Florian Goth
!
!> @brief
!> This function classifies the diagonal.
!> @param[in] mys a vector containing the chemical potentials.
!> @return 0: ZeroDiag, 1:HomogeneousSingleColExp, 2:Traceless: 3: General
!--------------------------------------------------------------------
function determinediagtype(nodes, nrnodes, mys) result(diagtype)
real(kind=kind(0.D0)), intent(in), dimension(:) :: mys
type(node), dimension(:), intent(in) :: nodes
integer, intent(in) :: nrnodes
integer :: diagtype
integer :: i
real(kind=kind(0.D0)) :: localzero
logical :: isequal, iszero, istraceless
! check for pairwise equality
isequal = .true.
do i = 1, nrnodes
if ( .not. fpequal(mys(nodes(i)%x), mys(nodes(i)%y ) )) then
isequal = .false.
endif
enddo
if(isequal) then
! check whether they are as good as zero.
iszero = .true.
do i = 1, nrnodes
localzero = 1E-15*abs(nodes(i)%axy)*sqrt(2.D0*(mys(nodes(i)%x)/abs(nodes(i)%axy) )**2 + 1.D0)
if (abs(mys(nodes(i)%x)) > localzero) iszero = .false.
enddo
if (iszero) then
diagtype = 0
else
diagtype = 1
endif
else
! check whether all blocks are traceless
istraceless = .true.
do i = 1, nrnodes
localzero = 1E-15*frobnorm(mys(nodes(i)%x), mys(nodes(i)%y), nodes(i)%axy)
if (abs(mys(nodes(i)%x) + mys(nodes(i)%y)) > localzero) istraceless = .false.
enddo
if (istraceless) then
diagtype = 2
else
diagtype = 3
endif
endif
end function
!--------------------------------------------------------------------
!> @author
!> Florian Goth
!
!> @brief
!> This function creates an exponential object from an array of nodes.
!
!> @param this The exponential object
!> @param[in] nodes The array of nodes
!> @param[in] usedcolors the number of used colors/terms in
!> the decomposition.
!> @param[in] dcols a usedcolors x ndim array that contains for each color the diagonal entries to be used.
!> @param[in] weight a prefactor of the exponent.
!--------------------------------------------------------------------
subroutine EulerExp_init(this, nodes, usedcolors, dcols, weight)
class(EulerExp) :: this
type(node), dimension(:), intent(in) :: nodes
integer, intent(in) :: usedcolors
real(kind=kind(0.D0)), intent(in), allocatable, dimension(:, :) :: dcols
real(kind=kind(0.d0)), intent(in) :: weight
integer, dimension(:), allocatable :: nredges ! An array for determining how many edges are there for each color
integer, dimension(:), allocatable :: edgectr ! A helper array for counting.
integer :: i, maxedges
! ! integer :: k
! ! character(64) :: filename
type(node), dimension(:, :), allocatable :: colsepnodes! An array of nodes separated by color
class(ZeroDiagSingleColExp), pointer :: zerodiagexp => null()
class(HomogeneousSingleColExp), pointer :: homexp => null()
class(TraceLessSingleColExp), pointer :: tracelessexp => null()
class(GeneralSingleColExp), pointer :: generalexp => null()
#ifndef NDEBUG
write(*,*) "Setting up Euler Checkerboard exponential."
#endif
! Determine the number of matrix entries in each family
allocate (nredges(usedcolors), edgectr(usedcolors))
nredges = 0
this%nrofcols = usedcolors
do i = 1, size(nodes)
nredges(nodes(i)%col) = nredges(nodes(i)%col) + 1
enddo
maxedges = maxval(nredges)
edgectr = 1
allocate(colsepnodes(usedcolors, maxedges))
do i = 1, size(nodes)
colsepnodes(nodes(i)%col, edgectr(nodes(i)%col)) = nodes(i)
edgectr(nodes(i)%col) = edgectr(nodes(i)%col) + 1
enddo
! ! Useful for generating input for mathematica
! ! do i = 1, usedcolors
! ! write (filename, "(A6,I3)") "matrix", i
! ! open(unit=5,file=filename)
! ! do k = 1, nredges(i)
! ! write (5, *) "{{", colsepnodes(i, k)%x, ",",colsepnodes(i, k)%y,"} -> ", dble(colsepnodes(i, k)%axy), "}"
! ! enddo
! ! close(unit=5)
! ! enddo
! Now that we have properly separated which entry of a matrix belongs to
! which color we can create an exponential for each color that exploits
! the structure, that the color decomposition creates strictly sparse matrices.
allocate(this%singleexps(usedcolors))
do i = 1, usedcolors
! In each color we have to determine which optimizations are possible
select case(determinediagtype( colsepnodes(i, :), nredges(i), dcols(i,:) ))
case(0)
allocate(zerodiagexp)
this%singleexps(i)%dat => zerodiagexp
case(1)
allocate(homexp)
this%singleexps(i)%dat => homexp
case(2)
allocate(tracelessexp)
this%singleexps(i)%dat => tracelessexp
case(3)
allocate(generalexp)
this%singleexps(i)%dat => generalexp
end select
call this%singleexps(i)%dat%init(colsepnodes(i, :), nredges(i), dcols(i, :), weight)
enddo
deallocate(nredges, edgectr, colsepnodes)
end subroutine EulerExp_init
end module Exponentials_mod