Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Major additions #4

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
8025465
[update] config for a test
Mc-Zen Apr 10, 2024
ef36eea
[add] PauliGrouper, now we can write file checkpoints
Mc-Zen Apr 20, 2024
c1e1990
[add] R_hat to output
Mc-Zen Apr 20, 2024
b7c464a
[add] number of groups to output
Mc-Zen Apr 20, 2024
8eb825c
[add] number of paulis to output
Mc-Zen Apr 20, 2024
6ad988d
[remove] format
Mc-Zen Apr 20, 2024
d6a4d2d
[fix] make it run on gcc-12
Mc-Zen Apr 20, 2024
1df6b49
[replace] std::format with fmt
Mc-Zen Apr 20, 2024
b65d85e
[fix] some print issues
Mc-Zen Apr 20, 2024
110679f
[fix] string type
Mc-Zen Apr 20, 2024
df46e3e
[add] option `generateTPBs` (boolean)
Mc-Zen Apr 21, 2024
e6aa8ba
[add] cli argument for config path
Mc-Zen Apr 22, 2024
40f46ad
[fix] absolute file paths on linux
Mc-Zen Apr 22, 2024
2ce4ad9
[fix] export new additional fields
Mc-Zen Apr 22, 2024
f25a8df
[fix] typo
Mc-Zen Apr 22, 2024
44a0346
[fix] allow CRLF linefeeds on linux
Mc-Zen Apr 23, 2024
13d5b12
[improve] only save one checkpoint
Mc-Zen Apr 23, 2024
ce1ea46
[add] connectivity `empty`
Mc-Zen Apr 23, 2024
ed4748c
[add] option `verboseLog`
Mc-Zen Apr 23, 2024
858e537
[add] flush cout from time to time
Mc-Zen Apr 25, 2024
ead4155
[fix] compute single-qubit layer in `PauliGrouper`
Mc-Zen Apr 26, 2024
9906cce
[add] Algorithm 2 (`grouperType = 2`)
Mc-Zen Apr 30, 2024
0377f48
[add] track grouper type and input filename in output file
Mc-Zen May 1, 2024
98600ac
[add] respect numGraphs with Algorithm 2
Mc-Zen May 1, 2024
225bae6
[add] connectivity: special-square-lattice-38
Mc-Zen May 2, 2024
64b38ad
[add] string_utility toLower()
Mc-Zen May 3, 2024
72e0fb6
[add] parse all config attributes as CLI arguments
Mc-Zen May 3, 2024
3baf183
[fix] small issues
Mc-Zen May 3, 2024
090b2c5
[update] license
Mc-Zen Jan 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ if (UNIT_TESTING)
endif()

add_subdirectory(src)
add_subdirectory(libs)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT grouper)
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Mc-Zen
Copyright (c) 2023-2025 Mc-Zen

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
22 changes: 22 additions & 0 deletions data/config water.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Configure your problem here.

# The filenames may be absolute: e.g., C:\Users\me\Desktop\myhamiltonian.txt)
# or relative to the data/ directory in the repository: e.g., ../myfolder/myhamiltonian.txt




filename = hamiltonians/water/water_361g_star_bk_1914.json # where to read the hamiltonian data from
outfilename = grouping_result/water/water_361g_star_bk_1914.json # where to output the grouping
connectivity = connectivities/linear.txt # which connectivity file to use



numGraphs = 100 # Hyperparameter: Maximum number of random subgraphs
maxEdgeCount = 1000 # Hyperparameter: Maximum number of edges for subgraphs
sortGraphsByEdgeCount = true # Sort possible subgraphs by edge count so graphs with lower edge count are preferred
extractComputationalBasis = true # Pre-eliminate Paulis in the computational basis like IIZ, ZIZ, ZZZ, ...



numThreads = 8 # option for multithreading
9 changes: 5 additions & 4 deletions data/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@


filename = hamiltonians/examples/H4_bk.json # where to read the hamiltonian data from
outfilename = grouping_result/examples/H4_bk_example.json # where to output the grouping
connectivity = connectivities/default_connectivity.txt # which connectivity file to use
outfilename = grouping_result/examples1/H4_bk.json # where to output the grouping
connectivity = connectivities/linear.txt # which connectivity file to use



numGraphs = 100000000 # Hyperparameter: Maximum number of random subgraphs
numGraphs = 1000 # Hyperparameter: Maximum number of random subgraphs
maxEdgeCount = 1000 # Hyperparameter: Maximum number of edges for subgraphs
sortGraphsByEdgeCount = true # Sort possible subgraphs by edge count so graphs with lower edge count are preferred
extractComputationalBasis = true # Pre-eliminate Paulis in the computational basis like IIZ, ZIZ, ZZZ, ...
intermediateFileFrequency = 0 # If != 0, an output file is written in the form <filename>_savingpoint_X.<extension> for every nth group



numThreads = 8 # option for multithreading
numThreads = 1 # option for multithreading
1 change: 1 addition & 0 deletions data/connectivities/empty.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
empty
38 changes: 38 additions & 0 deletions data/connectivities/grid38_linear_compatible.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 1 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 1 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 1 0 1 0 0 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0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 1 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 1 0 1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 1 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0
1 change: 1 addition & 0 deletions data/connectivities/linear.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
linear
14 changes: 0 additions & 14 deletions data/connectivities/square-lattice.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1 @@
# The connectivity may be either a type or an adjacency matrix

# Allowed types are: linear, cycle, star.
# For these, the correct number of qubits is inferred from the input data

# The adjacency matrix is specified by zeros and ones, e.g.
#
# 0 1 0 0 0
# 1 0 1 0 0
# 0 1 0 1 0
# 0 0 1 0 1
# 0 0 0 1 0
#

square-lattice
1 change: 1 addition & 0 deletions libs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add_subdirectory(fmt)
12 changes: 12 additions & 0 deletions libs/fmt/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
set(target fmt)

add_library(${target}
core.h
format.h
format-inl.h
color.h
ranges.h
format.cc
)

target_include_directories(${target} PUBLIC "${CMAKE_CURRENT_LIST_DIR}/..")
Loading