Skip to content

Commit 5d265b5

Browse files
authored
Fixing the deprecated calls (#3277)
Signed-off-by: Sachin Pisal <[email protected]>
1 parent f5fc188 commit 5d265b5

File tree

2 files changed

+20
-18
lines changed

2 files changed

+20
-18
lines changed

docs/sphinx/applications/cpp/vqe_h2.cpp

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -75,23 +75,24 @@ struct so4_fabric {
7575

7676
int main() {
7777
// Read in the spin op from file
78-
std::vector<double> h2_data{0, 0, 0, 0, -0.10647701149499994, 0.0,
79-
1, 1, 1, 1, 0.0454063328691, 0.0,
80-
1, 1, 3, 3, 0.0454063328691, 0.0,
81-
3, 3, 1, 1, 0.0454063328691, 0.0,
82-
3, 3, 3, 3, 0.0454063328691, 0.0,
83-
2, 0, 0, 0, 0.170280101353, 0.0,
84-
2, 2, 0, 0, 0.120200490713, 0.0,
85-
2, 0, 2, 0, 0.168335986252, 0.0,
86-
2, 0, 0, 2, 0.165606823582, 0.0,
87-
0, 2, 0, 0, -0.22004130022499996, 0.0,
88-
0, 2, 2, 0, 0.165606823582, 0.0,
89-
0, 2, 0, 2, 0.174072892497, 0.0,
90-
0, 0, 2, 0, 0.17028010135300004, 0.0,
91-
0, 0, 2, 2, 0.120200490713, 0.0,
92-
0, 0, 0, 2, -0.22004130022499999, 0.0,
93-
15};
94-
cudaq::spin_op H(h2_data, /*nQubits*/ 4);
78+
std::vector<double> h2_data{
79+
15, -0.10647701149499994, 0, 4, 0, 0, 1, 0, 2, 0, 3,
80+
0, 0.0454063328691, 0, 4, 0, 2, 1, 2, 2, 2, 3,
81+
2, 0.0454063328691, 0, 4, 0, 2, 1, 2, 2, 3, 3,
82+
3, 0.0454063328691, 0, 4, 0, 3, 1, 3, 2, 2, 3,
83+
2, 0.0454063328691, 0, 4, 0, 3, 1, 3, 2, 3, 3,
84+
3, 0.170280101353, 0, 4, 0, 1, 1, 0, 2, 0, 3,
85+
0, 0.120200490713, 0, 4, 0, 1, 1, 1, 2, 0, 3,
86+
0, 0.168335986252, 0, 4, 0, 1, 1, 0, 2, 1, 3,
87+
0, 0.165606823582, 0, 4, 0, 1, 1, 0, 2, 0, 3,
88+
1, -0.22004130022499996, 0, 4, 0, 0, 1, 1, 2, 0, 3,
89+
0, 0.165606823582, 0, 4, 0, 0, 1, 1, 2, 1, 3,
90+
0, 0.174072892497, 0, 4, 0, 0, 1, 1, 2, 0, 3,
91+
1, 0.170280101353, 0, 4, 0, 0, 1, 0, 2, 1, 3,
92+
0, 0.120200490713, 0, 4, 0, 0, 1, 0, 2, 1, 3,
93+
1, -0.22004130022499996, 0, 4, 0, 0, 1, 0, 2, 0, 3,
94+
1};
95+
cudaq::spin_op H(h2_data);
9596
// For 8 qubits, 36 parameters per layer
9697
int n_layers = 2, n_qubits = H.num_qubits(), block_size = 2, p_counter = 0;
9798
int n_blocks_per_layer = 2 * (n_qubits / block_size) - 1;

docs/sphinx/examples/cpp/executing_kernels_sample.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ __qpu__ void kernel(int qubit_count) {
2626

2727
int main() {
2828
int qubit_count = 2;
29-
auto produced_str = cudaq::draw(kernel, qubit_count);
29+
auto produced_str = cudaq::contrib::draw(kernel, qubit_count);
30+
printf("%s", produced_str.data());
3031
auto result = cudaq::sample(kernel, qubit_count);
3132
result.dump();
3233
return 0;

0 commit comments

Comments
 (0)