Trust-aware hand-over#

Trust-aware hand-over: a robot policy built on the trust qubit.

The robot hands objects to a person. Whether the person takes the object smoothly depends on how much they trust the robot at that moment, and trust changes with every success and failure (OpenSystemBelief). The robot can also ask about trust, which tells it where trust stands but, in the quantum-like model, also changes it (the question collapses the belief).

At each step the policy compares the expected cost of four actions:

handover

normal speed; fails with probability \(1 - p_{\text{trust}}\)

slow_handover

slower and more legible; costs slow_cost but halves the failure risk

ask

costs ask_cost; the answer collapses the belief, then the better of the two hand-overs is chosen for the next step (one-step look-ahead)

wait

costs wait_cost; the belief keeps dephasing toward its mixed state

The same policy can run on the classical MarkovBelief, where asking only reads trust; comparing the two shows when the order-aware model changes the robot’s behaviour.

Examples

>>> from quantum_mind.families.dynamics import OpenSystemBelief
>>> from quantum_mind.applications.handover import TrustAwareHandover
>>> policy = TrustAwareHandover(OpenSystemBelief(phi0=0.6, a_pos=0.8, a_neg=1.2, gamma=0.3))
>>> policy.decide()['action']                      # high trust: hand over normally
'handover'
>>> policy.observe(0); policy.observe(0)           # two failures
>>> policy.decide()['action'] != 'handover'
True

Classes

TrustAwareHandover

Hand-over policy on a trust belief.

Functions

simulate_handover_session

Run a policy against a simulated person whose trust follows a model.

class TrustAwareHandover(model, fail_cost=10.0, slow_cost=1.0, ask_cost=0.5, wait_cost=0.3, slow_factor=0.5)[source]#

Bases: object

Hand-over policy on a trust belief.

Parameters:
  • model (OpenSystemBelief or MarkovBelief) – Trust model, with its parameters (fitted to the person or the population).

  • fail_cost (float, optional) – Cost of a failed hand-over (dropped object, startled person).

  • slow_cost (float, optional) – Extra cost of a slow hand-over.

  • ask_cost (float, optional) – Cost of asking “do you trust me to hand this over?”.

  • wait_cost (float, optional) – Cost of waiting one step.

  • slow_factor (float, optional) – Failure probability of a slow hand-over relative to a normal one.

Variables:
  • rho (numpy.ndarray) – Current trust belief as a 2 x 2 density matrix (open-system model), or None.

  • p (float) – Current P(trust) (Markov model), or None.

property p_trust#

current probability that the person trusts the robot (says “yes”).

Type:

float

observe(event)[source]#

Update the belief after a hand-over outcome.

Parameters:

event (int) – 1 for a success, 0 for a failure.

answer(yes)[source]#

Update the belief after the person answers the trust question.

In the open-system model the answer collapses the belief onto “trust” or “no trust”; in the Markov model it sets P(trust) to 1 or 0.

Parameters:

yes (bool or int)

wait()[source]#

Let one step pass without a hand-over (dephasing only, open-system model).

decide()[source]#

Expected cost of each action and the best one.

Returns:

dict – action (the cheapest), costs ({action: expected cost}) and p_trust.

simulate_handover_session(policy, person, events_rng, n_steps=20)[source]#

Run a policy against a simulated person whose trust follows a model.

The person’s real trust (a separate copy of the model) determines whether each hand-over succeeds and how the trust question is answered; the policy only sees outcomes and answers.

Parameters:
Returns:

dict – cost (total), failures, asks and actions (list).