Skip to content

Commit cd0ade7

Browse files
authored
Merge branch 'main' into pr-cmake-default-changes
2 parents 836b6c7 + 8c3abf6 commit cd0ade7

File tree

11 files changed

+1254
-7
lines changed

11 files changed

+1254
-7
lines changed

.cudaq_version

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"cudaq": {
33
"repository": "NVIDIA/cuda-quantum",
4-
"ref": "5785e44256b757263879580c82cb84adc85bcf5a"
4+
"ref": "dcb0abaf464463061df38992b00f7c3150363d18"
55
}
66
}
7-

.github/workflows/sync.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,13 @@ jobs:
99
sync:
1010
name: Get Updates from Upstream
1111
if: ${{ github.repository != 'NVIDIA/cudaqx' }}
12-
permissions:
13-
actions: write
14-
contents: write
1512
runs-on: 'ubuntu-latest'
1613

1714
steps:
1815
- name: Checkout repository
1916
uses: actions/checkout@v4
17+
with:
18+
token: ${{ secrets.REPO_BOT_ACCESS_TOKEN }}
2019

2120
- name: Fast-forward ${{ github.ref_name }}
2221
run: |

.github/workflows/update-cudaq-dep.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
id: check_change
3131
run: |
3232
CURRENT_SHA=$(jq -r '.cudaq.ref' .cudaq_version)
33-
if [[ "${{ env.LATEST_SHA }}" == "$CURRENT_SHA" ]]; then
33+
if [[ "${{ env.sha }}" == "$CURRENT_SHA" ]]; then
3434
echo "No changes in SHA. Skipping PR creation."
3535
echo "changed=false" >> $GITHUB_OUTPUT
3636
else
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2024 NVIDIA Corporation & Affiliates. *
3+
* All rights reserved. *
4+
* *
5+
* This source code and the accompanying materials are made available under *
6+
* the terms of the Apache License 2.0 which accompanies this distribution. *
7+
******************************************************************************/
8+
#pragma once
9+
10+
#include "cudaq/solvers/operators/molecule/fermion_compiler.h"
11+
12+
namespace cudaq::solvers {
13+
14+
/// @brief Helper function used by the Bravyi-Kitaev transformation.
15+
cudaq::spin_op seeley_richard_love(std::size_t i, std::size_t j,
16+
std::complex<double> coef, int n_qubits);
17+
18+
/// @brief Map fermionic operators to spin operators via the
19+
/// Bravyi-Kitaev transformation.
20+
class bravyi_kitaev : public fermion_compiler {
21+
public:
22+
cudaq::spin_op generate(const double constant, const cudaqx::tensor<> &hpq,
23+
const cudaqx::tensor<> &hpqrs,
24+
const cudaqx::heterogeneous_map &options) override;
25+
26+
CUDAQ_EXTENSION_CREATOR_FUNCTION(fermion_compiler, bravyi_kitaev)
27+
};
28+
CUDAQ_REGISTER_TYPE(bravyi_kitaev)
29+
} // namespace cudaq::solvers

libs/solvers/lib/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ add_library(cudaq-solvers SHARED
1515
operators/molecule/drivers/pyscf_driver.cpp
1616
operators/molecule/fermion_compilers/fermion_compiler.cpp
1717
operators/molecule/fermion_compilers/jordan_wigner.cpp
18+
operators/molecule/fermion_compilers/bravyi_kitaev.cpp
1819
operators/molecule/molecule.cpp
1920
operators/graph/max_cut.cpp
2021
operators/graph/clique.cpp

0 commit comments

Comments
 (0)