pub struct QuantumGame {
pub game_type: GameType,
pub num_players: usize,
pub players: Vec<QuantumPlayer>,
pub game_circuit: Option<Array2<Complex64>>,
pub payoff_matrices: Vec<Array2<f64>>,
pub entanglement_operator: Option<Array2<Complex64>>,
}
Expand description
Quantum game engine
Fields§
§game_type: GameType
Type of game
num_players: usize
Number of players
players: Vec<QuantumPlayer>
Players in the game
game_circuit: Option<Array2<Complex64>>
Quantum circuit for the game
payoff_matrices: Vec<Array2<f64>>
Payoff matrices (one for each player)
entanglement_operator: Option<Array2<Complex64>>
Entanglement operator (if applicable)
Implementations§
Source§impl QuantumGame
impl QuantumGame
Sourcepub fn add_player(&mut self, player: QuantumPlayer) -> QuantRS2Result<()>
pub fn add_player(&mut self, player: QuantumPlayer) -> QuantRS2Result<()>
Add a player to the game
Sourcepub fn set_payoff_matrix(
&mut self,
player_id: usize,
payoffs: Array2<f64>,
) -> QuantRS2Result<()>
pub fn set_payoff_matrix( &mut self, player_id: usize, payoffs: Array2<f64>, ) -> QuantRS2Result<()>
Set payoff matrix for a specific player
Sourcepub fn quantum_prisoners_dilemma() -> QuantRS2Result<Self>
pub fn quantum_prisoners_dilemma() -> QuantRS2Result<Self>
Create quantum prisoner’s dilemma
Sourcepub fn quantum_coordination_game() -> QuantRS2Result<Self>
pub fn quantum_coordination_game() -> QuantRS2Result<Self>
Create quantum coordination game
Sourcepub fn quantum_auction(num_bidders: usize) -> QuantRS2Result<Self>
pub fn quantum_auction(num_bidders: usize) -> QuantRS2Result<Self>
Create quantum auction mechanism
Sourcepub fn play_game(&mut self) -> QuantRS2Result<GameOutcome>
pub fn play_game(&mut self) -> QuantRS2Result<GameOutcome>
Play the quantum game and return outcome
Sourcepub fn find_quantum_nash_equilibria(
&mut self,
) -> QuantRS2Result<Vec<GameOutcome>>
pub fn find_quantum_nash_equilibria( &mut self, ) -> QuantRS2Result<Vec<GameOutcome>>
Find quantum Nash equilibria using iterative algorithm
Sourcepub fn quantum_advantage(&mut self) -> QuantRS2Result<f64>
pub fn quantum_advantage(&mut self) -> QuantRS2Result<f64>
Compute quantum advantage over classical game
Trait Implementations§
Source§impl Clone for QuantumGame
impl Clone for QuantumGame
Source§fn clone(&self) -> QuantumGame
fn clone(&self) -> QuantumGame
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for QuantumGame
impl RefUnwindSafe for QuantumGame
impl Send for QuantumGame
impl Sync for QuantumGame
impl Unpin for QuantumGame
impl UnwindSafe for QuantumGame
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.