forked from NVIDIA/cuda-quantum
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnegation_error.cpp
More file actions
21 lines (18 loc) · 906 Bytes
/
negation_error.cpp
File metadata and controls
21 lines (18 loc) · 906 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*******************************************************************************
* 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. *
******************************************************************************/
// REQUIRES: c++20
// RUN: cudaq-quake -verify %s
#include <cudaq.h>
struct NegationOperatorTest {
void operator()() __qpu__ {
cudaq::qvector qr(3);
// expected-error@+1{{target qubit cannot be negated}}
x<cudaq::ctrl>(qr[0], qr[1], !qr[2]);
rz(2.0, !qr[0]); // expected-error{{target qubit cannot be negated}}
}
};