Conversation
| @@ -58,12 +62,33 @@ std::vector<std::vector<std::size_t>> read_grid_layout_from_stream( | |||
| * be populated by this method. | |||
| * @param output_states vector of output states for the given contraction | |||
There was a problem hiding this comment.
Update comment (output_states is no longer a parameter)
| /** | ||
| * Given a grid of 3D tensors, rename indexes of the terminal tensors to | ||
| * reflect terminal qubits. | ||
| * @param QflexFinalQubits representing the final qubits. |
There was a problem hiding this comment.
For specifying parameters in function comments, please use the format:
* @param <parameter_name> <parameter_description>
Also, it looks like some parameters are missing from this comment.
|
|
||
| /** | ||
| * Apply the final delta-tensors to the 3D grid of tensors. | ||
| * @param QflexGrid representing the circuit layout. |
There was a problem hiding this comment.
See previous comment.
| */ | ||
| std::vector<std::pair<std::string, std::complex<double>>> EvaluateCircuit( | ||
| QflexInput* input); | ||
| std::vector<std::tuple<std::string, std::string, std::complex<double>>> |
There was a problem hiding this comment.
With this change, the @return spec is no longer accurate - please update.
| qflex::global::track_memory_seconds, R"(]. | ||
| --initial-conf=<initial_conf> Initial configuration. | ||
| --final-conf=<final_conf> Final configuration. | ||
| --initial-conf=<initial_conf> Initial configuration [default: 00...00]. |
There was a problem hiding this comment.
This help message should indicate that multiple input/output strings are supported, and (briefly) describe how qFlex handles them.
95-martin-orion
left a comment
There was a problem hiding this comment.
I think I still need to review evaluate_circuit.cpp, but this should cover the rest.
| } | ||
| } | ||
|
|
||
| // Delete duplicate initial/final configuration |
There was a problem hiding this comment.
I'd actually suggest that we return an error if duplicates are detected. The reasoning is this: if a user manually specifies two input states, they probably meant to provide two different input states. Since a simulation run can take a long time, we should fail early so the user can correct their mistake.
| amplitudes.push_back({is, EvaluateCircuit(&input)}); | ||
| } | ||
| } | ||
| // Remove duplicate initial/final states |
There was a problem hiding this comment.
Same as above - duplicate states should produce an error.
| @@ -320,18 +318,10 @@ void circuit_data_to_tensor_network( | |||
| } | |||
|
|
|||
| // Check for the length of initial_conf and final_conf. | |||
|
|
||
| /** | ||
| * Return gate as an array. | ||
| * @param name of the gate. |
|
|
||
| /** | ||
| * Read circuit from stream and fill in a 2D grid of vectors of tensors. | ||
| * @param qflex::QflexCircuit containing circuit information. |
There was a problem hiding this comment.
Update function comment to reflect parameter changes. (Also looks like the first @param is missing its parameter name.)
| * work. | ||
| */ | ||
| void flatten_grid_of_tensors( | ||
| std::vector<std::vector<Tensor>> flatten_grid_of_tensors( |
There was a problem hiding this comment.
Update function comment.
| @@ -9,15 +9,18 @@ namespace { | |||
| class GetOutputStatesTest : public testing::Test { | |||
There was a problem hiding this comment.
File comment: could you add tests for multiple-(input/output) and the new functions (apply_terminal_cuts and apply_delta_output)?
| tensor_grid_3D, &tensor_grid_2D, &scratch); | ||
|
|
||
| // Reorder the 2D grid | ||
| reorder_grid_of_tensors(&tensor_grid_2D, final_qubits.qubits, |
There was a problem hiding this comment.
Would a separate test for reorder_grid_of_tensors make sense, or does this provide enough coverage as-is?
Improve code to handle multiple initial/final states.