forked from NVIDIA/cuda-quantum
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQIRFunctionNames.h
More file actions
97 lines (85 loc) · 4.68 KB
/
QIRFunctionNames.h
File metadata and controls
97 lines (85 loc) · 4.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/****************************************************************-*- C++ -*-****
* Copyright (c) 2022 - 2025 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
/// This file provides some common QIR function names for use throughout our
/// MLIR lowering infrastructure.
namespace cudaq::opt {
/// QIS Function name strings
static constexpr const char QIRQISPrefix[] = "__quantum__qis__";
static constexpr const char QIRMeasureBody[] = "__quantum__qis__mz__body";
static constexpr const char QIRMeasure[] = "__quantum__qis__mz";
static constexpr const char QIRMeasureToRegister[] =
"__quantum__qis__mz__to__register";
static constexpr const char QIRResetBody[] = "__quantum__qis__reset__body";
static constexpr const char QIRReset[] = "__quantum__qis__reset";
static constexpr const char QIRCnot[] = "__quantum__qis__cnot__body";
static constexpr const char QIRCphase[] = "__quantum__qis__cphase";
static constexpr const char QIRCZ[] = "__quantum__qis__cz__body";
static constexpr const char QIRReadResultBody[] =
"__quantum__qis__read_result__body";
static constexpr const char QIRCustomOp[] = "__quantum__qis__custom_unitary";
static constexpr const char QIRCustomAdjOp[] =
"__quantum__qis__custom_unitary__adj";
static constexpr const char QIRExpPauli[] = "__quantum__qis__exp_pauli";
static constexpr const char NVQIRInvokeWithControlBits[] =
"invokeWithControlQubits";
static constexpr const char NVQIRInvokeRotationWithControlBits[] =
"invokeRotationWithControlQubits";
static constexpr const char NVQIRInvokeU3RotationWithControlBits[] =
"invokeU3RotationWithControlQubits";
static constexpr const char NVQIRInvokeWithControlRegisterOrBits[] =
"invokeWithControlRegisterOrQubits";
static constexpr const char NVQIRGeneralizedInvokeAny[] =
"generalizedInvokeWithRotationsControlsTargets";
static constexpr const char NVQIRPackSingleQubitInArray[] =
"packSingleQubitInArray";
static constexpr const char NVQIRReleasePackedQubitArray[] =
"releasePackedQubitArray";
/// QIR Array function name strings
static constexpr const char QIRArrayGetElementPtr1d[] =
"__quantum__rt__array_get_element_ptr_1d";
static constexpr const char QIRArrayQubitAllocateArray[] =
"__quantum__rt__qubit_allocate_array";
static constexpr const char QIRArrayQubitAllocateArrayWithStateFP64[] =
"__quantum__rt__qubit_allocate_array_with_state_fp64";
static constexpr const char QIRArrayQubitAllocateArrayWithStateFP32[] =
"__quantum__rt__qubit_allocate_array_with_state_fp32";
static constexpr const char QIRArrayQubitAllocateArrayWithStateComplex64[] =
"__quantum__rt__qubit_allocate_array_with_state_complex64";
static constexpr const char QIRArrayQubitAllocateArrayWithStateComplex32[] =
"__quantum__rt__qubit_allocate_array_with_state_complex32";
static constexpr const char QIRArrayQubitAllocateArrayWithStatePtr[] =
"__quantum__rt__qubit_allocate_array_with_state_ptr";
static constexpr const char QIRArrayQubitAllocateArrayWithCudaqStatePtr[] =
"__quantum__rt__qubit_allocate_array_with_cudaq_state_ptr";
static constexpr const char QIRQubitAllocate[] =
"__quantum__rt__qubit_allocate";
static constexpr const char QIRArrayQubitReleaseArray[] =
"__quantum__rt__qubit_release_array";
static constexpr const char QIRArrayQubitReleaseQubit[] =
"__quantum__rt__qubit_release";
static constexpr const char QIRArraySlice[] = "__quantum__rt__array_slice";
static constexpr const char QIRArrayGetSize[] =
"__quantum__rt__array_get_size_1d";
static constexpr const char QIRArrayConcatArray[] =
"__quantum__rt__array_concatenate";
static constexpr const char QIRArrayCreateArray[] =
"__quantum__rt__array_create_1d";
/// Dynamic qubit management helper functions. These are currently only used by
/// the NVQIR simulator.
static constexpr const char QIRisDynamicQubitManagement[] =
"__quantum__rt__is_dynamic_qubit_management";
static constexpr const char QIRsetDynamicQubitManagement[] =
"__quantum__rt__set_dynamic_qubit_management";
/// QIR Base/Adaptive Profile record output function names
static constexpr const char QIRRecordOutput[] =
"__quantum__rt__result_record_output";
/// Custom NVQIR method to cleanup result maps in between consecutive programs.
static constexpr const char QIRClearResultMaps[] =
"__quantum__rt__clear_result_maps";
} // namespace cudaq::opt