From cea94c1e05ecdb8b11c5bee602e6b10f815f6295 Mon Sep 17 00:00:00 2001 From: Caleb Date: Tue, 15 Oct 2024 10:19:18 -0500 Subject: [PATCH 1/2] Get Dice from bidets branch and write dets as 16 bytes --- build.sh | 4 ++-- qiskit_addon_dice_solver/dice_solver.py | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/build.sh b/build.sh index 49ef0dc..55f0b1c 100755 --- a/build.sh +++ b/build.sh @@ -9,8 +9,8 @@ wget https://boostorg.jfrog.io/artifactory/main/release/1.85.0/source/boost_1_85 && tar -xzf boost_1_85_0.tar.gz -C $(pwd)/external \ && rm boost_1_85_0.tar.gz -# Clone Dice/Riken branch -git clone https://github.com/caleb-johnson/Dice.git $(pwd)/external/Dice +# Clone Dice/bigdets branch +git clone -b bigdets https://github.com/caleb-johnson/Dice.git $(pwd)/external/Dice export BOOST_ROOT=$(pwd)/external/boost_1_85_0 export CURC_HDF5_ROOT=/usr/lib/x86_64-linux-gnu/hdf5/openmpi/ diff --git a/qiskit_addon_dice_solver/dice_solver.py b/qiskit_addon_dice_solver/dice_solver.py index 80888bc..10ec222 100644 --- a/qiskit_addon_dice_solver/dice_solver.py +++ b/qiskit_addon_dice_solver/dice_solver.py @@ -91,8 +91,8 @@ def solve_hci( .. note:: - Determinants are interpreted by the ``Dice`` command line application as 5-byte unsigned integers; therefore, only systems - of ``40`` or fewer orbitals are supported. + Determinants are interpreted by the ``Dice`` command line application as 16-byte unsigned integers; therefore, only systems + of ``128`` or fewer orbitals are supported. Args: hcore: Core Hamiltonian matrix representing single-electron integrals. @@ -212,8 +212,8 @@ def solve_fermion( .. note:: - Determinants are interpreted by the ``Dice`` command line application as 5-byte unsigned integers; therefore, only systems - of ``40`` or fewer orbitals are supported. + Determinants are interpreted by the ``Dice`` command line application as 16-byte unsigned integers; therefore, only systems + of ``128`` or fewer orbitals are supported. Args: bitstring_matrix: A set of configurations defining the subspace onto which the Hamiltonian @@ -298,8 +298,8 @@ def solve_dice( .. note:: - Determinant addresses are interpreted by the ``Dice`` command line application as 5-byte unsigned integers; therefore, only systems - of ``40`` or fewer orbitals are supported. + Determinant addresses are interpreted by the ``Dice`` command line application as 16-byte unsigned integers; therefore, only systems + of ``128`` or fewer orbitals are supported. Args: addresses: A length-2 tuple of ``Sequence`` containing base-10, unsigned integer @@ -507,12 +507,12 @@ def _write_input_files( def _integer_to_bytes(n: int) -> bytes: """ - Pack an integer into 5 bytes. + Pack an integer into 16 bytes. - The 5 is hard-coded because that is what the modified Dice branch + The 16 is hard-coded because that is what the modified Dice branch expects currently. """ - return int(n).to_bytes(5, byteorder="big") + return int(n).to_bytes(16, byteorder="big") def _address_list_to_bytes(addresses: Sequence[int]) -> list[bytes]: From a00cd1db005c0d6d7e1bfce35214f12b3e6c4ded Mon Sep 17 00:00:00 2001 From: Caleb Date: Wed, 4 Dec 2024 16:06:19 -0600 Subject: [PATCH 2/2] reno --- releasenotes/notes/bigdets-ab774bbfc91ff01d.yaml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 releasenotes/notes/bigdets-ab774bbfc91ff01d.yaml diff --git a/releasenotes/notes/bigdets-ab774bbfc91ff01d.yaml b/releasenotes/notes/bigdets-ab774bbfc91ff01d.yaml new file mode 100644 index 0000000..eff2e82 --- /dev/null +++ b/releasenotes/notes/bigdets-ab774bbfc91ff01d.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + Bitstrings are no longer limited to ``80`` bits. Bitstrings up to length ``256`` are now accepted.