Skip to content

Commit

Permalink
Merge branch 'issues/hist-multi' of https://github.com/AnimeshSinha13…
Browse files Browse the repository at this point in the history
…09/quantum-cirq into issues/hist-multi
  • Loading branch information
AnimeshSinha1309 committed Jun 7, 2020
2 parents fe415aa + 41ba33b commit 8cadd59
Show file tree
Hide file tree
Showing 20 changed files with 399 additions and 289 deletions.
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Mark generated protobuf files to be collapsed by default in PRs
# See: https://github.com/github/linguist/#generated-code
*_pb2.py linguist-generated=true
*_pb2.pyi linguist-generated=true

5 changes: 5 additions & 0 deletions cirq/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
bidiagonalize_unitary_with_special_orthogonals,
block_diag,
CONTROL_TAG,
deconstruct_single_qubit_matrix_into_angles,
diagonalize_real_symmetric_and_sorted_diagonal_matrices,
diagonalize_real_symmetric_matrix,
dot,
Expand All @@ -139,6 +140,7 @@
kron_with_controls,
map_eigenvalues,
match_global_phase,
matrix_commutes,
matrix_from_basis_coefficients,
partial_trace,
partial_trace_of_state_vector_as_mixture,
Expand Down Expand Up @@ -315,6 +317,7 @@
STATE_VECTOR_LIKE,
to_valid_density_matrix,
to_valid_state_vector,
validate_indices,
validate_normalized_state,
validate_normalized_state_vector,
validate_qid_shape,
Expand Down Expand Up @@ -379,6 +382,7 @@
Sweepable,
to_resolvers,
to_sweep,
to_sweeps,
TrialResult,
UnitSweep,
Zip,
Expand Down Expand Up @@ -479,6 +483,7 @@
to_json,
obj_to_dict_helper,
trace_distance_bound,
trace_distance_from_angle_list,
unitary,
validate_mixture,
)
Expand Down
56 changes: 28 additions & 28 deletions cirq/google/api/v1/operations_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

64 changes: 32 additions & 32 deletions cirq/google/api/v1/params_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 24 additions & 24 deletions cirq/google/api/v1/program_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions cirq/google/api/v2/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,33 @@ package(default_visibility = ["//visibility:public"])

load("@com_google_protobuf//:protobuf.bzl", "py_proto_library")

proto_library(
name = "batch_proto",
srcs = ["batch.proto"],
deps = [
":program_proto",
":result_proto",
":run_context_proto"
],
)

py_proto_library(
name = "batch_py_proto",
srcs = ["batch.proto"],
deps = [
":program_py_proto",
":result_py_proto",
":run_context_py_proto"
],
)

cc_proto_library(
name = "batch_cc_proto",
deps = [
":batch_proto"
],
)

proto_library(
name = "device_proto",
srcs = ["device.proto"],
Expand Down
58 changes: 58 additions & 0 deletions cirq/google/api/v2/batch.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
syntax = "proto3";

import "cirq/google/api/v2/program.proto";
import "cirq/google/api/v2/result.proto";
import "cirq/google/api/v2/run_context.proto";

package cirq.google.api.v2;

option java_package = "com.google.cirq.google.api.v2";
option java_outer_classname = "BatchProto";
option java_multiple_files = true;

// A Batch of multiple circuits that should be run together
// as one QuantumProgram within Quantum Engine.
//
// Note: Batching is done on a best-effort basis.
// Circuits will be be bundled together, but the size
// of the total batch and different hardware constraints may
// cause the programs to be executed seperately on the hardware.
message BatchProgram {

// The circuits that should be bundled together as one program
repeated Program programs = 1;
}

// A batch of contexts for running a bundled batch of programs
// To be used in conjunction with BatchProgram
message BatchRunContext {

// Run contexts for each program in the BatchProgram
// Each RunContext should map directly to a Program in the corresponding
// BatchProgram.
//
// This message must have one RunContext for each Program in the
// BatchProgram, and the order of the RunContext messages should
// match the order of the Programs in the BatchProgram.
repeated RunContext run_contexts = 1;
}


// The result returned from running a BatchProgram/BatchRunContext
message BatchResult {

// Results returned from executing a BatchProgram/BatchRunContext pair.
//
// After a BatchProgram and BatchRunContext is successfully run in
// Quantum Engine, the expected result if successful will be a BatchResult.
//
// Each Result in this message will directly correspond to a Program/
// RunContext pair in the request. There will be one Result in this message
// for each corresponding pair in the request and the order of the Results
// will match the order of the Programs from the request.
//
// In case of partial results, an empty (default) Result object will be
// populated for programs that were not able to be run correctly.
repeated Result results = 1;
}

Loading

0 comments on commit 8cadd59

Please sign in to comment.