-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.cpp
More file actions
41 lines (28 loc) · 917 Bytes
/
main.cpp
File metadata and controls
41 lines (28 loc) · 917 Bytes
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
#include "types.hpp"
#include "states.hpp"
#include "local_statevector.hpp"
#include "distributed_statevector.hpp"
#include "distributed_densitymatrix.hpp"
#include "test_utilities.hpp"
#include <stdio.h>
#include <iostream>
#include <complex>
#include <chrono>
using namespace std::chrono;
using namespace std::complex_literals;
int main() {
comm_init();
Nat numQubits = 26;
StateVector state = StateVector(numQubits);
NatArray targets = {0,6,4,2};
AmpMatrix matrix = getRandomMatrix( powerOf2(targets.size()) );
auto start = high_resolution_clock::now();
comm_synch();
distributed_statevector_manyTargGate(state, targets, matrix);
comm_synch();
auto stop = high_resolution_clock::now();
auto dur = duration_cast<microseconds>(stop - start).count();
rootNodePrint("done in " + std::to_string(dur) + " microseconds\n");
comm_end();
return 0;
}