Small bug fixed

This commit is contained in:
ysyapa 2023-08-16 22:06:19 +00:00
parent 54bd6c20f4
commit 56a8808938
1 changed files with 24 additions and 16 deletions

View File

@ -2,24 +2,32 @@ using DelimitedFiles
rotations = readdlm("rotations.mat", ',', Int, '\n') rotations = readdlm("rotations.mat", ',', Int, '\n')
rotations = reshape(rotations, (24, 3, 3)) rotations = reshape(rotations, (24, 3, 3))
N = 24 function get_A1_labels(N::Int)
ks = -N÷2:N÷2-1 rotations = readdlm("rotations.csv", ',', Int, '\n')
lattice = hcat((collect.(Iterators.product(ks, ks, ks)))...) rotations = reshape(rotations, (24, 3, 3))
labels = reshape(collect(1:N^3), (N, N, N))
for r in 1:24 ks = -N÷2:N÷2-1
rotated_lattice = Matrix(rotations[r, :, :]) * lattice lattice = hcat((collect.(Iterators.product(ks, ks, ks)))...)
for index in 1:N^3 labels = reshape(collect(1:N^3), (N, N, N))
rotated_lattice_point = rotated_lattice[:, index]
(i, j, k) = mod1.(rotated_lattice_point .+ (N÷2 + 1), N) for r in 1:24
old_label = max(labels[index], labels[i, j, k]) rotated_lattice = Matrix(rotations[r, :, :]) * lattice
new_label = min(labels[index], labels[i, j, k]) for index in 1:N^3
if old_label != new_label rotated_lattice_point = rotated_lattice[:, index]
for o in findall(isequal(old_label), labels) (i, j, k) = mod1.(rotated_lattice_point .+ (N÷2 + 1), N)
labels[o] = new_label old_label = max(labels[index], labels[i, j, k])
new_label = min(labels[index], labels[i, j, k])
if old_label != new_label
for o in findall(isequal(old_label), labels)
labels[o] = new_label
end
end end
end end
end end
return labels
end end
unique(labels) function sym_reduce(N::Int, K_full)
end