Skip to content

Silent conversion of compiled function #5

@marcelolooser

Description

@marcelolooser

Problem:
Compiled (non-reciprocal) Abelian Bloch Hamiltonians with symbolic coupling constants seem to be silently converted to uncompiled functions during the diagonalization process (Mathematica version 14.0). The fundamental issue is that the compiled functions used in the tutorials contain global variables.

Affected pages:
Haldane model, Hatano-Nelson model and Higher-order topology

Suggestion :
Use Compile manually to convert global variables to function arguments (analogous for supercells and non-reciprocal models):

fHamPC = AbelianBlochHamiltonian[pcmodel, Norbs, onsitePC, hoppingsPC];
argsPC = Join[fHamPC[[1]], coupling constants, ... ];
Hpc = Compile[Evaluate[argsPC], Evaluate[fHamPC[[2]]]];

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions