Skip to content

Commit

Permalink
Merge branch 'main' into pr-cmake-default-changes
Browse files Browse the repository at this point in the history
  • Loading branch information
bmhowe23 authored Jan 7, 2025
2 parents 836b6c7 + 8c3abf6 commit cd0ade7
Show file tree
Hide file tree
Showing 11 changed files with 1,254 additions and 7 deletions.
3 changes: 1 addition & 2 deletions .cudaq_version
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"cudaq": {
"repository": "NVIDIA/cuda-quantum",
"ref": "5785e44256b757263879580c82cb84adc85bcf5a"
"ref": "dcb0abaf464463061df38992b00f7c3150363d18"
}
}

5 changes: 2 additions & 3 deletions .github/workflows/sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ jobs:
sync:
name: Get Updates from Upstream
if: ${{ github.repository != 'NVIDIA/cudaqx' }}
permissions:
actions: write
contents: write
runs-on: 'ubuntu-latest'

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.REPO_BOT_ACCESS_TOKEN }}

- name: Fast-forward ${{ github.ref_name }}
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-cudaq-dep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
id: check_change
run: |
CURRENT_SHA=$(jq -r '.cudaq.ref' .cudaq_version)
if [[ "${{ env.LATEST_SHA }}" == "$CURRENT_SHA" ]]; then
if [[ "${{ env.sha }}" == "$CURRENT_SHA" ]]; then
echo "No changes in SHA. Skipping PR creation."
echo "changed=false" >> $GITHUB_OUTPUT
else
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*******************************************************************************
* Copyright (c) 2024 NVIDIA Corporation & Affiliates. *
* All rights reserved. *
* *
* This source code and the accompanying materials are made available under *
* the terms of the Apache License 2.0 which accompanies this distribution. *
******************************************************************************/
#pragma once

#include "cudaq/solvers/operators/molecule/fermion_compiler.h"

namespace cudaq::solvers {

/// @brief Helper function used by the Bravyi-Kitaev transformation.
cudaq::spin_op seeley_richard_love(std::size_t i, std::size_t j,
std::complex<double> coef, int n_qubits);

/// @brief Map fermionic operators to spin operators via the
/// Bravyi-Kitaev transformation.
class bravyi_kitaev : public fermion_compiler {
public:
cudaq::spin_op generate(const double constant, const cudaqx::tensor<> &hpq,
const cudaqx::tensor<> &hpqrs,
const cudaqx::heterogeneous_map &options) override;

CUDAQ_EXTENSION_CREATOR_FUNCTION(fermion_compiler, bravyi_kitaev)
};
CUDAQ_REGISTER_TYPE(bravyi_kitaev)
} // namespace cudaq::solvers
1 change: 1 addition & 0 deletions libs/solvers/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ add_library(cudaq-solvers SHARED
operators/molecule/drivers/pyscf_driver.cpp
operators/molecule/fermion_compilers/fermion_compiler.cpp
operators/molecule/fermion_compilers/jordan_wigner.cpp
operators/molecule/fermion_compilers/bravyi_kitaev.cpp
operators/molecule/molecule.cpp
operators/graph/max_cut.cpp
operators/graph/clique.cpp
Expand Down
Loading

0 comments on commit cd0ade7

Please sign in to comment.