Skip to content

Commit

Permalink
Use virtual functions
Browse files Browse the repository at this point in the history
  • Loading branch information
erick-xanadu committed Aug 12, 2024
1 parent 01a4bcf commit e3c2b71
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
6 changes: 0 additions & 6 deletions frontend/catalyst/third_party/oqc/src/OQCDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,6 @@ void OQCDevice::PartialCounts(DataView<double, 1> &eigvals, DataView<int64_t, 1>
// After this poitn everything is unsupported
auto OQCDevice::AllocateQubit() -> QubitIdType { RT_FAIL("Unsupported functionality"); }
void OQCDevice::PrintState() { RT_FAIL("Unsupported functionality"); }
void OQCDevice::SetState(DataView<std::complex<double>, 1> &)
{
RT_FAIL("Unsupported functionality");
}

void OQCDevice::SetBasisState(const std::size_t) { RT_FAIL("Unsupported functionality"); }

void OQCDevice::Counts(DataView<double, 1> &eigvals, DataView<int64_t, 1> &counts, size_t shots)
{
Expand Down
4 changes: 2 additions & 2 deletions runtime/include/QuantumDevice.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,15 @@ struct QuantumDevice {
*/
virtual void SetState(DataView<std::complex<double>, 1> &, std::vector<QubitIdType> &wires)

Check warning on line 165 in runtime/include/QuantumDevice.hpp

View check run for this annotation

Codecov / codecov/patch

runtime/include/QuantumDevice.hpp#L165

Added line #L165 was not covered by tests
{
RT_ASSERT(false);
RT_FAIL("Unsupported functionality");

Check warning on line 167 in runtime/include/QuantumDevice.hpp

View check run for this annotation

Codecov / codecov/patch

runtime/include/QuantumDevice.hpp#L167

Added line #L167 was not covered by tests
}

/**
* @brief Function to set state to vector of complex variables.
*/
virtual void SetBasisState(DataView<int8_t, 1> &, std::vector<QubitIdType> &wires)

Check warning on line 173 in runtime/include/QuantumDevice.hpp

View check run for this annotation

Codecov / codecov/patch

runtime/include/QuantumDevice.hpp#L173

Added line #L173 was not covered by tests
{
RT_ASSERT(false);
RT_FAIL("Unsupported functionality");

Check warning on line 175 in runtime/include/QuantumDevice.hpp

View check run for this annotation

Codecov / codecov/patch

runtime/include/QuantumDevice.hpp#L175

Added line #L175 was not covered by tests
}

/**
Expand Down

0 comments on commit e3c2b71

Please sign in to comment.