Maestro
0.3.11
Unified interface for quantum circuit simulation
Loading...
Searching...
No Matches
RoutingMap.h
Go to the documentation of this file.
1
#pragma once
2
#include <type_traits>
3
#include <utility>
4
#include <vector>
5
6
namespace
Simulators::Private
7
{
8
// Keep Maestro buildable with older QCSim releases. Without an authoritative
9
// map, use the native local optimizer instead of a possibly stale mirror.
10
template
<
class
T,
class
=
void
>
struct
HasRoutingMap
: std::false_type
11
{
12
};
13
14
template
<
class
T>
struct
HasRoutingMap
<T, std::void_t<decltype(std::declval<const T &>().getQubitsMap())>> : std::true_type
15
{
16
};
17
18
template
<
class
T> std::vector<long long>
ReadRoutingMap
(
const
T *simulator)
19
{
20
if
constexpr
(
HasRoutingMap<T>::value
)
21
{
22
if
(simulator)
23
{
24
const
auto
&map = simulator->getQubitsMap();
25
return
{map.begin(), map.end()};
26
}
27
}
28
return
{};
29
}
30
}
// namespace Simulators::Private
Simulators::Private
Definition
FusionSimulator.h:5
Simulators::Private::ReadRoutingMap
std::vector< long long > ReadRoutingMap(const T *simulator)
Definition
RoutingMap.h:18
Simulators::Private::HasRoutingMap
Definition
RoutingMap.h:11
Simulators
QCSim
RoutingMap.h
Generated on
for Maestro by
1.16.1