Skip to content

Commit c3b949c

Browse files
committed
renamed samples storage
1 parent d67d303 commit c3b949c

6 files changed

Lines changed: 19 additions & 19 deletions

File tree

src/frame.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ void Framing::sample() {
2525
timer.start();
2626
LOGHEADER(1, 4, "Simulation");
2727
if (options.progress_en) print_progress_header();
28-
recorder.alloc(tableau, gpu_allocator);
28+
samples_record.alloc(tableau, gpu_allocator);
2929
gpu_circuit.reset_circuit_offset(0);
3030
for (depth_t d = 0; d < depth && !timeout; d++)
3131
step(d);

src/frame.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#pragma once
22

33
#include "simulator.hpp"
4-
#include "record.cuh"
4+
#include "samples.cuh"
55

66
namespace QuaSARQ {
77

88
class Framing : public Simulator {
99

1010
size_t num_shots;
11-
Recorder recorder;
11+
Samples samples_record;
1212

1313
public:
1414

src/options.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace QuaSARQ {
1717
#define FOREACH_PRINT(CONFIG) \
1818
CONFIG(gates, "gates") \
1919
CONFIG(signs, "signs") \
20-
CONFIG(record, "sampling outcome") \
20+
CONFIG(sample, "sampling outcome") \
2121
CONFIG(measurements, "measurements") \
2222
CONFIG(initialstate, "initial state (in Pauli strings)") \
2323
CONFIG(stepstate, "step state (in Pauli strings)") \

src/print.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ namespace QuaSARQ {
404404
LOGHEADER(0, 3, "Measurements");
405405
SETCOLOR(CLBLUE, stdout);
406406
const size_t MAX_ROW = 32;
407-
PRINT("record(0:%lld): ", (num_qubits < MAX_ROW ? num_qubits : MAX_ROW) - 1);
407+
PRINT("rec(0:%lld): ", (num_qubits < MAX_ROW ? num_qubits : MAX_ROW) - 1);
408408
tableau.copy_to_host(nullptr, nullptr, &record);
409409
const size_t offset = tableau.num_qubits_padded();
410410
for (size_t i = 0; i < num_qubits; ++i) {

src/record.cu renamed to src/samples.cu

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace QuaSARQ {
66

77
void print_record(
8-
const Table& record,
8+
const Table& samples,
99
const size_t num_qubits,
1010
const size_t num_shots) {
1111
string qidx = "q%-4lld";
@@ -15,8 +15,8 @@ namespace QuaSARQ {
1515
PRINT(qidx.c_str(), int64(q));
1616
int count = 0;
1717
for (size_t s = 0; s < num_shots; s++) {
18-
const size_t word_idx = q * record.num_words_minor() + WORD_OFFSET(s);
19-
const word_std_t& word = record[word_idx];
18+
const size_t word_idx = q * samples.num_words_minor() + WORD_OFFSET(s);
19+
const word_std_t& word = samples[word_idx];
2020
const word_std_t bitpos = s & WORD_MASK;
2121
const int bit = (word >> bitpos) & 1;
2222
count += bit;
@@ -35,7 +35,7 @@ namespace QuaSARQ {
3535
const uint64 seed,
3636
Table * xs,
3737
Table * zs,
38-
Table * record)
38+
Table * samples)
3939
{
4040
curandStatePhilox4_32_10_t st;
4141
for_parallel_y(i, num_gates) {
@@ -47,7 +47,7 @@ namespace QuaSARQ {
4747
const size_t q = gate.wires[0];
4848
assert(q != INVALID_QUBIT);
4949
const size_t q_word_idx = q * num_words_minor + w;
50-
(*record)[q_word_idx] ^= (*xs)[q_word_idx];
50+
(*samples)[q_word_idx] ^= (*xs)[q_word_idx];
5151
randomize_word(
5252
(*zs)[q_word_idx],
5353
st,
@@ -77,7 +77,7 @@ namespace QuaSARQ {
7777
tableau.num_words_minor(),
7878
options.seed,
7979
XZ_TABLE(tableau),
80-
recorder.device
80+
samples_record.device
8181
);
8282
stats.circuit.measure_stats.random += num_gates_per_window;
8383
stats.circuit.measure_stats.definite = 0;
@@ -91,12 +91,12 @@ namespace QuaSARQ {
9191
}
9292

9393
void Framing::print() {
94-
if (!options.print_record) return;
94+
if (!options.print_sample) return;
9595
if (!options.sync) SYNCALL;
9696
LOGHEADER(1, 4, "Sampling");
97-
recorder.copy();
97+
samples_record.copy();
9898
print_record(
99-
recorder.host,
99+
samples_record.host,
100100
num_qubits,
101101
num_shots
102102
);

src/record.cuh renamed to src/samples.cuh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@
66

77
namespace QuaSARQ {
88

9-
struct Recorder {
9+
struct Samples {
1010
Table *device;
1111
word_t *device_data;
1212
Table host;
1313

14-
Recorder() : device(nullptr), device_data(nullptr) {}
15-
~Recorder() {
14+
Samples() : device(nullptr), device_data(nullptr) {}
15+
~Samples() {
1616
device = nullptr;
1717
device_data = nullptr;
18-
if (options.print_record) {
18+
if (options.print_sample) {
1919
host.destroy();
2020
}
2121
}
@@ -26,7 +26,7 @@ namespace QuaSARQ {
2626
Table tmp;
2727
tmp.alloc(device_data, tableau.num_qubits_padded(), tableau.num_words_major(), tableau.num_words_minor());
2828
CHECK(cudaMemcpyAsync(device, &tmp, sizeof(Table), cudaMemcpyHostToDevice));
29-
if (options.print_record)
29+
if (options.print_sample)
3030
host.alloc_host(tableau.num_qubits_padded(), tableau.num_words_major(), tableau.num_words_minor());
3131
}
3232

0 commit comments

Comments
 (0)