Comments (7)
Maybe part of BaseAnalysis
?
from qiskit-experiments.
That could also work.
from qiskit-experiments.
Based on our discussion offline, let me add some discussion points.
I was first proposing to have internal data structure in columnar format, so that we can manage arbitrary xvalue (in QPT, xvalue may consist of multiple column of "meas_basis" and "prep_basis", Hamiltonian tomography may have more). More specifically, we can generate a dataframe
in the BaseExperiment
class. Data added to the instance will be immediately formatted and stored in the dataframe.
The point was if we really need such internal data representation at the cost of extra dependency. Because the list of dictionary shown above is still enough to generate xy values, and we can locally store the exp data instance as a json. However, I see two advantages of having such internal data structure.
-
data handling
dataframe
can provide variety filtering methods. So we don't need to loop over the list manually. -
saveing/loading data
json dump is not great method due to the serialization overhead. If we store the experiment result of 3Q QPT, we need to store typ. 1728 entries. I didn't benchmark this yet, but I imagine this will generate huge datafile and dump/load take long time.dataframe
can support multiple binary file format such as hdf5.
Perhaps we can start from simple dict structure above, and switch to have proper data structure at some point.
from qiskit-experiments.
As we discussed in #24 , ambiguity of metadata field should be resolved by this extraction function. Sometime we cannot define explicit series
, i.e. see Hamiltonian tomography example, it would be better to have API
def extract_xy_values(exp_data: ExperimentData, data_key: str, **filter: Any) -> Tuple[np.array, np.array]:
so that we can write
extract_xy_values(ham_tomo_data, data_key='delay', meas_basis='X', control_state=0)
Another point I want to discuss is how to extend this function to
- no scan (e.g. discriminator)
- multi-axes scan (e.g. chevron)
because current function supports only single data_key
.
One possible solution would be:
def extract_xy_values(exp_data: ExperimentData, *data_key: str, **filter: Any) -> Union[np.array, Tuple[np.array, np.array]]:
Then we can extract x-y value more flexibly.
- no data key
extract_xy_values(discr_data, prep_state=0) -> np.ndarray(1, N)
- 1d scan
extract_xy_values(ramsey_data, 'delay', meas_basis='x') -> Tuple[np.array(1, N), np.array(1, N)]
- 2d scan
extract_xy_values(ramsey_data, 'delay', 'detuning') -> Tuple[np.array(2, N), np.array(1, N)]
from qiskit-experiments.
I updated the curve fit PR to allow a bit more generic way of getting x and y data in its helper functions:
It now has
def curve_fit_data(
data: List[Dict[str, any]],
data_processor: Callable,
x_key: str = "xval"
) -> Tuple[xdata: ndarray(N), ydata: ndarray(N), sigma: ndarray(N)]
and
def multi_curve_fit_data(
data: List[Dict[str, any]],
data_processor: Callable,
x_key: str = "xval",
series_key: str = "series"
) -> Tuple[xdata: ndarray(N, 2), ydata: ndarray(N), sigma: ndarray(N)]
I think these cover the last two cases naoki mentioned above (minus filtering which would be a nice addition). The no-scan case I don't see as xy data at all. It is just regular data processing since you are converting a list of data into some array of values (Note the array convention is transposed to the one Naoki suggests because of the way i originally wrote the curve_fit
and multi_curve_fit
functions which these are designed to extract the input for)
Here the data_processor
function is a bit different to the data processor PR, but is a callable with specific signature data_processor(data: Dict[str, any]) -> Tuple[y: float, sigma: float]
from qiskit-experiments.
Can this be closed? @chriseclectic
from qiskit-experiments.
Closing as this issue was addressed
from qiskit-experiments.
Related Issues (20)
- Deprecate BackendData.is_simulator HOT 1
- Experiment serialization HOT 9
- Investigate performance of ExperimentData regarding adding more data to it
- `save` to report success and result database link
- Copied analysis result not saving to cloud service
- Clearly mark analysis result names in documentation
- Build release notes for older patch releases
- Implementing an adaptive Trotter decomposition that dynamically adjusts the number of Trotter steps based on the complexity of the quantum circuit. HOT 2
- Median Quartiles and Box Plots HOT 1
- Investigation of Quantum Sources for Time-Correlated Noise in Solid-State Quantum Devices HOT 2
- Error in the plotter if there is no valid fitter error
- Returning `Pauli` or `SparsePauliOp` analysis results implicitly calls their `to_matrix` method when adding to dataframe HOT 2
- Progress/status indicator?
- Randomized benchmarking fails to analyze the results from IBM Eagle, due to the lack of 2Q gate decomposition value for ECR gate
- Add `SamplerV2` support
- Jobs retrieved from hardware do not write "physical_qubits" metadata, causing MitigatedTomographyAnalysis to fail HOT 2
- Extensions patch release blocking `qiskit` PR HOT 3
- Regularize provider/service interface
- Track changes in experiment circuits
- Update visualization tutorial
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qiskit-experiments.