Skip to content

Commit

Permalink
Merge branch 'main' into plugin_example
Browse files Browse the repository at this point in the history
  • Loading branch information
melody-ren authored Dec 20, 2024
2 parents 347c022 + 2a1ae81 commit 2688e7e
Show file tree
Hide file tree
Showing 9 changed files with 1,251 additions and 3 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": "1a4f99ef78964a096a09b82fdecc796e10350806"
}
}

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 2688e7e

Please sign in to comment.