-
Notifications
You must be signed in to change notification settings - Fork 0
/
quantum_visuals.h
86 lines (76 loc) · 2.41 KB
/
quantum_visuals.h
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
/*******************************************************
* Copyright (c) 2022, ArrayFire
* All rights reserved.
*
* This file is distributed under 3-clause BSD license.
* The complete license agreement can be obtained at:
* http://arrayfire.com/licenses/BSD-3-Clause
********************************************************/
/**
* @file quantum_visuals.h
* @brief Provides functions for displaying useful information about quantum states and quantum circuits
* implemented by AQS
*
*/
#pragma once
#include "quantum.h"
namespace aqs {
/**
* @brief Prints the given qubit state to the stdout stream
*
* @param state Qubit State
*/
void print_state(const QState& state);
/**
* @brief Prints the circuit matrix represenatation to the stdout stream
*
* @param circuit circuit to be displayed
*/
void print_circuit_matrix(const QCircuit& circuit);
/**
* @brief Prints the global state stored in the simulator to the stdout stream
*
* @param simulator simulator storing the global state
*/
void print_statevector(const QSimulator& simulator);
/**
* @brief Prints the given qubit state profile to the stdout stream
*
* @param profile profile of the measurements done on a qubit
*/
void print_profile(const std::array<uint32_t, 2>& profile);
/**
* @brief Prints the given global state profile to the stdout stream
*
* @param profile profile of the measurements done on the quantum simulation
* global state
*/
void print_profile(const std::vector<uint32_t>& profile);
/**
* @brief Generates a text image using the circuit passed and initial states
* stored in simulator
*
* @param circuit circuit to display
* @param simulator simulator containing initial states
* @return std::string utf8 text image
*/
std::string gen_circuit_text_image(const QCircuit& circuit,
const QSimulator& simulator);
/**
* @brief Generates a text image using the schematic with the custom AQS
* displayer language
*
* @param schematic string of the schematic
* @return std::string utf8 text image
*/
std::string gen_circuit_text_image(std::string schematic);
/**
* @brief Prints the text image of the circuit and inititial states passed to
* the stdout stream
*
* @param circuit circuit to display
* @param simulator simulator containing initial states
*/
void print_circuit_text_image(const QCircuit& circuit,
const QSimulator& simulator);
} // namespace aqs